Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 94 95 96 97 98 99 100 101 102 103 104 .. 5022
502,152 events total
2020-09-20 16:48:02 <sm[m]> lechner: you're right, it's not crystal clear, but yes I'm 99% sure it descends. Probably you tested it by now
2020-09-20 16:49:03 Dolly joins (585fd1fd@ti0203q160-5312.bb.online.no)
2020-09-20 16:49:48 knupfer joins (~Thunderbi@i59F7FF48.versanet.de)
2020-09-20 16:49:55 igghibu joins (~igghibu@net-93-66-17-40.cust.vodafonedsl.it)
2020-09-20 16:50:47 × pingiun quits (~pingiun@j63019.upc-j.chello.nl) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-09-20 16:51:09 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
2020-09-20 16:53:42 <nshepperd2> whoa i just converted this dynamic programming-based tokenization thing from a laziness based pure Vector implementation to a mutable unboxed vector in ST, and it got like 100 times faster
2020-09-20 16:54:02 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-09-20 16:54:26 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-09-20 16:54:39 <ski> top-down to bottom-up ?
2020-09-20 16:54:45 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-09-20 16:55:52 <nshepperd2> I'm not quite sure what those terms mean, but yes I think so
2020-09-20 16:57:15 <nshepperd2> the lazy one was let table = V.generate (n+1) go; go = ...; in table!n
2020-09-20 16:57:19 kenran joins (~maier@b2b-37-24-119-190.unitymedia.biz)
2020-09-20 16:57:45 <nshepperd2> the fast one was to make a mutable unboxed vector and fill it out in order from 0 to n
2020-09-20 16:57:49 <ski> where `go' referred to `table'
2020-09-20 16:57:55 <nshepperd2> yeah
2020-09-20 16:58:17 <sshine> >_<
2020-09-20 16:58:24 <ski> hm, what kind of access pattern ?
2020-09-20 16:59:25 <nshepperd2> 'go i' would reference some or all cells between i-5 and i-1
2020-09-20 16:59:34 <hekkaidekapus> sm[m]: The 1% wins again :p It does not descend. At its core, the function calls doesFileExist to the supplied dirs.
2020-09-20 17:00:12 × ajfelfjlsdkfjejf quits (~jfkeflkwe@2600:1700:4640:c560:68bd:9d76:dbd8:24e7) (Quit: Leaving)
2020-09-20 17:00:20 <hekkaidekapus> doesFileExist (dir </> file)
2020-09-20 17:00:24 <ski> "bottom-up" means that you fill in the "lower cells", before the higher ones, "prematurely" so to speak. "top-down" that you start demanding higher ones, which in turn demands lower ones (which are cached)
2020-09-20 17:00:39 <dolio> There's a lot of overhead in the top-down lazy approach.
2020-09-20 17:00:54 <dolio> If you're working with integers.
2020-09-20 17:01:10 sleblanc joins (~sleblanc@unaffiliated/sebleblanc)
2020-09-20 17:01:47 <nshepperd2> ski: then yeah, that's exactly what i did
2020-09-20 17:01:59 <ski> nshepperd2 : i suppose you could even use a five-tuple, or a vector of size five, then
2020-09-20 17:02:41 × kenran quits (~maier@b2b-37-24-119-190.unitymedia.biz) (Ping timeout: 260 seconds)
2020-09-20 17:03:28 × igghibu quits (~igghibu@net-93-66-17-40.cust.vodafonedsl.it) (Quit: Konversation terminated!)
2020-09-20 17:03:37 <dolio> Yeah, like computing fibonacci with an accumulator pair.
2020-09-20 17:04:10 <ski> (you'd use `mod i 5')
2020-09-20 17:05:09 <ski> i suppose the computation of the next cell isn't a linear function of the previous five ones ..
2020-09-20 17:05:10 × zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving)
2020-09-20 17:06:52 × elliott_ quits (~elliott@2600:380:9266:42eb:7b5e:250e:ef35:8b08) (Ping timeout: 260 seconds)
2020-09-20 17:07:20 <ski> nshepperd2 : probably the lazy approach would work better, in case there's many cells which aren't needed to compute the result
2020-09-20 17:07:38 coot joins (~coot@37.30.49.42.nat.umts.dynamic.t-mobile.pl)
2020-09-20 17:08:00 notzmv` joins (~user@177.103.86.92)
2020-09-20 17:08:11 <dolio> Yeah, there are a lot of factors making it sub-optimal for this case.
2020-09-20 17:08:29 zaquest joins (~notzaques@5.128.210.178)
2020-09-20 17:08:37 hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net)
2020-09-20 17:10:10 × cheater quits (~user@unaffiliated/cheater) (Read error: Connection reset by peer)
2020-09-20 17:10:37 <sshine> I have a data type, data Foo a = X a | Y a | Z a | P | Q | R; and I'd like to make a type NumFoo = forall n. Num n => Foo n, but it seems that I can't do that. what are my alternatives? I was thinking of a data type with a type class constraint.
2020-09-20 17:10:59 <sshine> I think I can use GADTs, but that would require me to alter 'Foo', too, right?
2020-09-20 17:11:18 × notzmv quits (~user@unaffiliated/zmv) (Ping timeout: 256 seconds)
2020-09-20 17:11:46 cheater joins (~user@unaffiliated/cheater)
2020-09-20 17:11:55 <nshepperd2> ski: yeah in this case pretty much all cells are eventually needed
2020-09-20 17:13:30 <ski> sshine : why can't you ?
2020-09-20 17:13:33 <hyperisco> sshine, what is the idea of this type? I don't understand
2020-09-20 17:14:26 <ski> a value of type `NumFoo' possibly contains a number of any numeric type the user wants to get
2020-09-20 17:14:52 Lord_of_Life_ joins (~Lord@unaffiliated/lord-of-life/x-0885362)
2020-09-20 17:15:26 × mariatsji quits (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e) (Remote host closed the connection)
2020-09-20 17:16:00 mariatsji joins (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e)
2020-09-20 17:16:27 igghibu joins (~igghibu@91.193.5.10)
2020-09-20 17:16:50 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 272 seconds)
2020-09-20 17:16:50 Lord_of_Life_ is now known as Lord_of_Life
2020-09-20 17:22:38 × igghibu quits (~igghibu@91.193.5.10) (Quit: Textual IRC Client: www.textualapp.com)
2020-09-20 17:22:54 <zebrag> I believe `cons :: a -> List l a -> List (Succ l) a` cannot be done with plain GADT? (The following ref, might suggest it could be done?? https://www.cis.upenn.edu/~sweirich/talks/GADT.pdf, page 9)
2020-09-20 17:23:15 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-09-20 17:23:45 <hyperisco> zebrag, is there a compiler error you're seeing?
2020-09-20 17:23:56 × Dolly quits (585fd1fd@ti0203q160-5312.bb.online.no) (Remote host closed the connection)
2020-09-20 17:24:14 × mariatsji quits (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e) (Remote host closed the connection)
2020-09-20 17:24:18 <zebrag> At least if you consider `Succ` is a data constructor
2020-09-20 17:24:25 mariatsji joins (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e)
2020-09-20 17:24:39 <zebrag> hyperisco: no I'm just reading the slides above
2020-09-20 17:25:59 <hyperisco> all I don't understand is how that is an example of dependent types
2020-09-20 17:26:07 × tzh quits (~tzh@2601:448:c500:5300::ad1c) (Ping timeout: 260 seconds)
2020-09-20 17:26:20 <hyperisco> what is your objection?
2020-09-20 17:26:37 kindaro joins (5f6e6241@h95-110-98-65.dyn.bashtel.ru)
2020-09-20 17:26:57 × suppi quits (~suppi@172.246.241.246) (Ping timeout: 260 seconds)
2020-09-20 17:27:06 × mariatsji quits (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e) (Remote host closed the connection)
2020-09-20 17:27:26 pingiun joins (~pingiun@j63019.upc-j.chello.nl)
2020-09-20 17:27:30 Dolly joins (585fd1fd@ti0203q160-5312.bb.online.no)
2020-09-20 17:29:08 <Cale> sshine: Just replace "type NumFoo = ..." with "data NumFoo = ..." and what you wrote is valid code, if a little bit useless. Forgetting everything about the type of number except that it was a type of number will mean that you can't really do a whole lot with it (in particular, you won't know that it's the same type as any other type of number, so the arithmetic you can perform is very limited)
2020-09-20 17:30:13 <Cale> sshine: Or did you really want to define a type synonym for the universal type?
2020-09-20 17:31:09 <c_wraith> Cale: it's a bit worse than that since Show is no longer a superclass of Num. Num doesn't give you any eliminator to see the value.
2020-09-20 17:31:10 × DirefulSalt quits (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt) (Remote host closed the connection)
2020-09-20 17:31:18 <Cale> Right
2020-09-20 17:31:27 <Cale> and Eq is gone too
2020-09-20 17:31:48 <c_wraith> Eq would be pretty useless, though, unless you wanted to test for lack of reflexivity or something
2020-09-20 17:32:16 <Cale> You could test out arithmetical identities involving your one value of the given type :)
2020-09-20 17:32:41 <c_wraith> hah. is x + x == x ? :)
2020-09-20 17:32:45 <Cale> yeah
2020-09-20 17:33:08 <hyperisco> no
2020-09-20 17:33:15 GyroW_ joins (~GyroW@ptr-48ujrfb8c7gfd2lu92q.18120a2.ip6.access.telenet.be)
2020-09-20 17:33:18 × supercoven quits (~Supercove@dsl-hkibng32-54fb54-166.dhcp.inet.fi) (Ping timeout: 272 seconds)
2020-09-20 17:33:43 <Cale> (that's essentially the same as checking if x == 0, if the instance is lawful)
2020-09-20 17:33:48 <c_wraith> I suppose the Num instance would let you throw in literals too, so you could ask if x * 0 == x
2020-09-20 17:33:49 × GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 272 seconds)
2020-09-20 17:33:51 mariatsji joins (~mariatsji@2a01:79d:53aa:c66c:342b:5324:f59b:5b0e)
2020-09-20 17:34:21 <c_wraith> That's not true in a modular ring
2020-09-20 17:34:41 <c_wraith> Oh, I guess it is. nevermind me!
2020-09-20 17:34:49 <phadej> x * 0 = 0, not x ?
2020-09-20 17:35:14 <Cale> That was another equation that would only be satisfied when x == 0
2020-09-20 17:35:27 <c_wraith> Anyway. The real point is that a value of an unknown type with a Num instance is very low.
2020-09-20 17:35:28 <Cale> (again, a fun thing to check holds in any ring)
2020-09-20 17:35:37 <hyperisco> I guess you can use this to dynamically determine which laws might hold
2020-09-20 17:35:54 tzh joins (~tzh@c-73-94-222-143.hsd1.mn.comcast.net)
2020-09-20 17:35:56 <c_wraith> If you add in Eq, you can do that
←Prev  Next→
Page 1 .. 94 95 96 97 98 99 100 101 102 103 104 .. 5022

All times are in UTC.