Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,797,199 events total
2026-02-24 23:00:02 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-24 23:04:20 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-24 23:07:49 <lantti> mine was https://privatebin.net/?97447d6805a0ea49#CfnZntNYLfYtSvpCod6DSKRYS8xDhzqycvhjmKNhppjv
2026-02-24 23:07:59 <haskellbridge> <ijouw> My solution fails locally at readLn? I am confused.
2026-02-24 23:10:11 emmanuelux joins (~em@user/emmanuelux)
2026-02-24 23:10:36 <haskellbridge> <ijouw> I was using a library which wraps reads with Maybe and forgot to adjust the type...
2026-02-24 23:10:50 <haskellbridge> <ijouw> When removing it so i can submit with fewer deps
2026-02-24 23:15:24 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-24 23:19:15 <mauke> lantti: I suggest changing "otherwise" to "print" for even more confusion
2026-02-24 23:19:45 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-02-24 23:20:59 × snek quits (sid280155@id-280155.lymington.irccloud.com) (Server closed connection)
2026-02-24 23:21:11 snek joins (sid280155@id-280155.lymington.irccloud.com)
2026-02-24 23:21:44 <lantti> mauke: is it not meant to be used like that? is it only for gurads then?
2026-02-24 23:22:21 <lantti> guards, even
2026-02-24 23:23:39 × saolsen quits (sid26430@id-26430.lymington.irccloud.com) (Server closed connection)
2026-02-24 23:23:50 saolsen joins (sid26430@id-26430.lymington.irccloud.com)
2026-02-24 23:25:00 <lantti> but looking at my code now I do admit that there are some decisions that only make sense if you consider that they were the smallest change to the previous version, like the decision to include the lengths of the sets in the same list as the sets themselves
2026-02-24 23:25:38 <lantti> (the previous version used length on the generated lists)
2026-02-24 23:26:53 <lantti> (and the term "step squad" comes from the BBC childrens series called Numberblocks)
2026-02-24 23:29:25 <lantti> (which I can recommend to anyone with children in the 1-3 primary school or earlier)
2026-02-24 23:30:47 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-24 23:32:16 <lantti> should I use _ -> as the catch all case then? I'm not working with haskell all that much as one may notice
2026-02-24 23:33:05 Comstar joins (~Comstar@user/Comstar)
2026-02-24 23:33:39 × acidsys quits (~crameleon@openSUSE/member/crameleon) (Server closed connection)
2026-02-24 23:33:54 acidsys joins (~crameleon@openSUSE/member/crameleon)
2026-02-24 23:34:09 × emmanuelux quits (~em@user/emmanuelux) (Quit: bye)
2026-02-24 23:35:05 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-02-24 23:36:05 <int-e> mauke: Yeah that looks like the best solution. Kind of sad; the simple greedy algorithm for the knapsack problem would work here.
2026-02-24 23:36:15 emmanuelux joins (~em@user/emmanuelux)
2026-02-24 23:37:02 <int-e> (but then you'd have to accumulate a full result before printing anything)
2026-02-24 23:38:57 chenjf joins (~chenjf@68.64.178.54)
2026-02-24 23:39:39 × tamer quits (~tamer@user/tamer) (Server closed connection)
2026-02-24 23:40:00 tamer joins (~tamer@5.2.74.82)
2026-02-24 23:40:59 × bjs quits (sid190364@user/bjs) (Server closed connection)
2026-02-24 23:41:15 bjs joins (sid190364@user/bjs)
2026-02-24 23:44:58 <Comstar> I can't think of a way to implement breadth-first searches (for the sake of discussion assume for a binary tree) that doesn't use a `Control.Monad.State` implementation
2026-02-24 23:45:29 <Comstar> do y'all know of a more pure approach? I guess I could do like, some folding magic
2026-02-24 23:45:49 <Comstar> I feel like I could probably find some neat code examples searching around github &al
2026-02-24 23:46:11 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-24 23:46:25 × chenjf quits (~chenjf@68.64.178.54) (Quit: WeeChat 4.8.1)
2026-02-24 23:47:13 <int-e> Comstar: If you have a state S and function branch :: S -> [S] then the list monad's bind (aka concatMap) can produce the next level of a tree from the previous one. (This gets a bit awkward if you also want to record history, but you can make that part of S)
2026-02-24 23:47:36 <Comstar> yeah that makes sense
2026-02-24 23:47:54 <int-e> "history" being the path through the underlying tree
2026-02-24 23:48:15 <Leary> Comstar: There was a haskell challenge for this a while back. This was my solution: https://gist.github.com/LSLeary/5083d1dfe403d1562e7778713d97b22a
2026-02-24 23:49:31 <int-e> Leary: that task is related but abuses Foldable on an infinite tree that you already have as a value.
2026-02-24 23:50:18 <int-e> (and it's an abuse because that Semigroup instance isn't lawful)
2026-02-24 23:50:40 <Comstar> Leary, oh wow line 25 in `Search.hs` is really interesting, I didn't know you could do `\case` like that, does that trick have a name?
2026-02-24 23:50:51 <Comstar> oh it's prob the LambdaCase language extension
2026-02-24 23:50:56 <int-e> it is
2026-02-24 23:50:56 <Leary> int-e: Do we not have a (foldable) binary tree to search? And yes, I agree, but specialising the code to a binary tree means we can kill the evil.
2026-02-24 23:50:57 <Comstar> that'll be fun to explore
2026-02-24 23:51:32 <int-e> Leary: I don't know whether we have one. My main point was that it's abuse.
2026-02-24 23:51:56 × earthy quits (~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net) (Ping timeout: 268 seconds)
2026-02-24 23:53:06 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-02-24 23:53:16 peterbecich joins (~Thunderbi@71.84.33.135)
2026-02-24 23:53:22 <lantti> mauke: oh, now i see. so the "otherwise" only worked because any identifier would have worked there
2026-02-24 23:53:41 <int-e> I've implemented quite a few breadth first searches in Haskell and I've never materialized the tree; only levels (usually as lists because it's convenient, or as sets because I expected a significant number of transpositions.)
2026-02-25 00:04:13 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 00:04:16 × GdeVolpiano quits (~GdeVolpia@user/GdeVolpiano) (Ping timeout: 268 seconds)
2026-02-25 00:05:12 Tuplanolla joins (~Tuplanoll@88-114-89-88.elisa-laajakaista.fi)
2026-02-25 00:05:55 <Comstar> what's materializing the tree mean?
2026-02-25 00:07:54 <int-e> I mean constructing a (potentially infinite) value of type `Tree S` where `data Tree s = Node s [Tree s]` from a root :: S and a branching function as above.
2026-02-25 00:08:45 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-02-25 00:11:08 <EvanR> lantti, going through String is probably not great, and then i/o on the Char is doing unicode stuff, and ...
2026-02-25 00:11:43 GdeVolpiano joins (~GdeVolpia@user/GdeVolpiano)
2026-02-25 00:16:27 × peterbecich quits (~Thunderbi@71.84.33.135) (Ping timeout: 246 seconds)
2026-02-25 00:19:04 <Comstar> int-e, heard, thanks!
2026-02-25 00:19:36 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 00:20:33 <EvanR> materialize = have the normal form all in memory ?
2026-02-25 00:20:57 <int-e> EvanR: well, no; laziness will still be a factor.
2026-02-25 00:22:11 <int-e> EvanR: But yes, I may be abusing terminology a bit here.
2026-02-25 00:23:55 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-25 00:26:39 <int-e> EvanR: The main reason I think of it that way is that it becomes harder to ensure that you expand exactly the parts of the tree that you need and you also release them to the garbage collector once you're done with them.
2026-02-25 00:29:43 robobub joins (uid248673@id-248673.uxbridge.irccloud.com)
2026-02-25 00:34:42 <EvanR> yes constructing an infinite value seems kind of vague operationally, so agree that makes it hard to predict the memory usage pattern
2026-02-25 00:34:58 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 00:39:20 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-25 00:39:39 × tritlo quits (sid58727@id-58727.hampstead.irccloud.com) (Server closed connection)
2026-02-25 00:39:50 tritlo joins (sid58727@id-58727.hampstead.irccloud.com)
2026-02-25 00:40:59 × lally quits (sid388228@id-388228.uxbridge.irccloud.com) (Server closed connection)
2026-02-25 00:41:14 lally joins (sid388228@id-388228.uxbridge.irccloud.com)
2026-02-25 00:46:17 × xff0x quits (~xff0x@ai083101.d.east.v6connect.net) (Ping timeout: 265 seconds)
2026-02-25 00:50:21 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 00:55:03 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds)
2026-02-25 01:05:43 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 01:10:10 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-25 01:21:05 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 01:24:27 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2026-02-25 01:27:49 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-25 01:39:06 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 01:40:15 Sgeo joins (~Sgeo@user/sgeo)
2026-02-25 01:43:30 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-25 01:43:57 × Tuplanolla quits (~Tuplanoll@88-114-89-88.elisa-laajakaista.fi) (Ping timeout: 246 seconds)
2026-02-25 01:52:44 wickedjargon joins (~user@2605:8d80:5430:8458:d04:837d:bf6b:e6b3)
2026-02-25 01:54:28 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-02-25 01:56:23 × Vizious quits (~bes@user/Vizious) (Quit: WeeChat 4.8.1)
2026-02-25 01:58:55 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-25 01:59:57 uli-fem joins (~uli-fem@118.210.1.123)
2026-02-25 02:01:23 × uli-fem quits (~uli-fem@118.210.1.123) (Changing host)
2026-02-25 02:01:23 uli-fem joins (~uli-fem@user/uli-fem)

All times are in UTC.