Newest at the top
2025-07-25 11:23:04 +0200 | <lambdabot> | foldr f z (x:xs) = f x (foldr f z xs) |
2025-07-25 11:23:04 +0200 | <lambdabot> | foldr f z [] = z |
2025-07-25 11:23:04 +0200 | <Leary> | @src foldr |
2025-07-25 11:21:57 +0200 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 248 seconds) |
2025-07-25 11:20:55 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) Tuplanolla |
2025-07-25 11:13:26 +0200 | <ethereal_> | as far as i understood list are structured 1:2:3:4:[] so it seems to me that it is much more "expensive" to go from right to left instead of the other way around |
2025-07-25 11:12:49 +0200 | kuribas | (~user@ptr-17d51em1891au96qoa1.18120a2.ip6.access.telenet.be) kuribas |
2025-07-25 11:12:20 +0200 | <ethereal_> | but I don't get why the author used foldr instead of perhaps foldl in this case |
2025-07-25 11:11:59 +0200 | <ethereal_> | for finding the corresponding value to a key and wrapping it in a Maybe v |
2025-07-25 11:11:21 +0200 | <ethereal_> | findKey key = foldr (\(k,v) acc -> if key == k then Just v else acc) Nothing |
2025-07-25 11:11:17 +0200 | <ethereal_> | I'm currently reading through the lyah book and this is one of the examples |
2025-07-25 11:09:15 +0200 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
2025-07-25 11:07:00 +0200 | haritz | (~hrtz@user/haritz) haritz |
2025-07-25 11:07:00 +0200 | haritz | (~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8) (Changing host) |
2025-07-25 11:07:00 +0200 | haritz | (~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8) |
2025-07-25 11:04:43 +0200 | trickard_ | trickard |
2025-07-25 11:04:13 +0200 | LainIwakura | (~LainIwaku@user/LainIwakura) LainIwakura |
2025-07-25 11:03:54 +0200 | dhil | (~dhil@5.151.29.137) (Ping timeout: 260 seconds) |
2025-07-25 10:57:46 +0200 | dhil | (~dhil@5.151.29.137) dhil |
2025-07-25 10:50:23 +0200 | LainIwakura | (~LainIwaku@user/LainIwakura) (Quit: Client closed) |
2025-07-25 10:40:33 +0200 | ethereal_ | (~ethereal@user/ethereal-:30935) ethereal_ |
2025-07-25 10:40:08 +0200 | caubert | (~caubert@user/caubert) caubert |
2025-07-25 10:39:52 +0200 | ethereal_ | (~ethereal@user/ethereal-:30935) (Client Quit) |
2025-07-25 10:39:39 +0200 | ethereal_ | (~ethereal@user/ethereal-:30935) ethereal_ |
2025-07-25 10:38:44 +0200 | <merijn> | Leary: Yes, I know about Unsatisfiable, that gist was the reason I proposed adding such a thing to GHC :p |
2025-07-25 10:38:10 +0200 | jreicher | (~user@user/jreicher) jreicher |
2025-07-25 10:36:33 +0200 | CiaoSen | (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) CiaoSen |
2025-07-25 10:34:59 +0200 | <Leary> | Re type applications to constraints, it seems to work fine? https://play.haskell.org/saved/Efh4MP7v |
2025-07-25 10:34:48 +0200 | __monty__ | (~toonn@user/toonn) toonn |
2025-07-25 10:34:23 +0200 | <Leary> | merijn: That technique is more about escaping the unordered, open world of instances for (ordered) closed type families; I don't see how it helps here. Also, you would want to use `Unsatisfiable` for those errors these days. |
2025-07-25 10:31:45 +0200 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2025-07-25 10:30:22 +0200 | <merijn> | Similar abuse: https://gist.github.com/merijn/6130082 |
2025-07-25 10:30:08 +0200 | chele | (~chele@user/chele) chele |
2025-07-25 10:29:50 +0200 | <merijn> | absence: So my idea won't save you if you wanna use TypeApplications, but just in case it happens to give you inspiration: Constraints are just type level families that you can compute with type level functions: https://gist.github.com/merijn/39dc86e345e87276c523 |
2025-07-25 10:27:40 +0200 | caubert | (~caubert@user/caubert) (Ping timeout: 276 seconds) |
2025-07-25 10:26:46 +0200 | LainIwakura | (~LainIwaku@user/LainIwakura) LainIwakura |
2025-07-25 10:26:22 +0200 | <merijn> | Apparently @ application doesn't support Constraint |
2025-07-25 10:26:11 +0200 | <merijn> | Ah, I just discovered a fun limitation xD |
2025-07-25 10:22:52 +0200 | <merijn> | Well it matters, because I'm trying to make an example with explicit Constraints and I dunno how to change the type because I don't understand what it's doing |
2025-07-25 10:22:13 +0200 | caubert | (~caubert@user/caubert) caubert |
2025-07-25 10:22:10 +0200 | jreicher | (~user@user/jreicher) (Read error: Connection reset by peer) |
2025-07-25 10:22:09 +0200 | <lortabac> | I don't think it matters much what test1 does. IIUC the point of the example is the type application |
2025-07-25 10:21:37 +0200 | <merijn> | it's basically const? |
2025-07-25 10:21:24 +0200 | trickard_ | (~trickard@cpe-62-98-47-163.wireline.com.au) |
2025-07-25 10:21:18 +0200 | <merijn> | *test1 |
2025-07-25 10:21:15 +0200 | <merijn> | I was trying to make another example, but I don't understand what test is doing |
2025-07-25 10:21:11 +0200 | trickard | (~trickard@cpe-62-98-47-163.wireline.com.au) (Read error: Connection reset by peer) |
2025-07-25 10:20:08 +0200 | jreicher | (~user@user/jreicher) jreicher |
2025-07-25 10:20:03 +0200 | <lortabac> | oh I see |
2025-07-25 10:18:57 +0200 | <lortabac> | can't you apply the constraint tuple directly? |