2025/07/25

Newest at the top

2025-07-25 11:20:55 +0200Tuplanolla(~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 +0200kuribas(~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 +0200tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
2025-07-25 11:07:00 +0200haritz(~hrtz@user/haritz) haritz
2025-07-25 11:07:00 +0200haritz(~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8) (Changing host)
2025-07-25 11:07:00 +0200haritz(~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8)
2025-07-25 11:04:43 +0200trickard_trickard
2025-07-25 11:04:13 +0200LainIwakura(~LainIwaku@user/LainIwakura) LainIwakura
2025-07-25 11:03:54 +0200dhil(~dhil@5.151.29.137) (Ping timeout: 260 seconds)
2025-07-25 10:57:46 +0200dhil(~dhil@5.151.29.137) dhil
2025-07-25 10:50:23 +0200LainIwakura(~LainIwaku@user/LainIwakura) (Quit: Client closed)
2025-07-25 10:40:33 +0200ethereal_(~ethereal@user/ethereal-:30935) ethereal_
2025-07-25 10:40:08 +0200caubert(~caubert@user/caubert) caubert
2025-07-25 10:39:52 +0200ethereal_(~ethereal@user/ethereal-:30935) (Client Quit)
2025-07-25 10:39:39 +0200ethereal_(~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 +0200jreicher(~user@user/jreicher) jreicher
2025-07-25 10:36:33 +0200CiaoSen(~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 +0200ljdarj(~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 +0200chele(~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 +0200caubert(~caubert@user/caubert) (Ping timeout: 276 seconds)
2025-07-25 10:26:46 +0200LainIwakura(~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 +0200caubert(~caubert@user/caubert) caubert
2025-07-25 10:22:10 +0200jreicher(~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 +0200trickard_(~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 +0200trickard(~trickard@cpe-62-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-07-25 10:20:08 +0200jreicher(~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?
2025-07-25 10:15:44 +0200jreicher(~user@user/jreicher) (Read error: Connection reset by peer)
2025-07-25 10:14:04 +0200 <merijn> oh, might not even need TypeFamilies
2025-07-25 10:13:10 +0200 <Leary> It needs to be partially applied.
2025-07-25 10:12:53 +0200 <merijn> You can simply write a type family combining your constraints straightup