2024/12/22

Newest at the top

2024-12-22 18:42:33 +0100 <albet70> ski , what's the delimited continuation
2024-12-22 18:41:51 +0100 <albet70> enikar , but call/cc still in r4rs?
2024-12-22 18:41:42 +0100 <ski> (albet70 : and no recursive computation needed/permitted, apart from the one inside `foldr')
2024-12-22 18:39:12 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds)
2024-12-22 18:38:44 +0100 <ski> `callCC' is delimited by the `runCont'/`runContT', yes
2024-12-22 18:38:34 +0100 <enikar> albet70: https://okmij.org/ftp/continuations/against-callcc.html
2024-12-22 18:38:11 +0100 <sinbad> c_wraith: thank you
2024-12-22 18:38:00 +0100 <ski> albet70 : the challenge was to implement `zipWith' (or `zip', if you prefer), only traversing either input list (and only once), with a single call to `foldr' for each, not inspecting the lists in any way apart from that
2024-12-22 18:36:54 +0100__monty__(~toonn@user/toonn) (Ping timeout: 265 seconds)
2024-12-22 18:36:21 +0100 <enikar> there are arguments against call/cc.
2024-12-22 18:35:27 +0100son0p(~ff@186.121.98.118) son0p
2024-12-22 18:35:24 +0100 <albet70> callCC only capture what is inside callCC
2024-12-22 18:34:45 +0100 <albet70> call/cc in scheme can capture the outside/rest code of call/cc, I don't think Cont or callCC in haskell can do that
2024-12-22 18:32:56 +0100 <monochrom> You can make your own yield in Haskell: https://www.vex.net/~trebla/haskell/cont.xhtml#yield
2024-12-22 18:32:16 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-12-22 18:31:23 +0100son0p(~ff@186.121.98.118) (Remote host closed the connection)
2024-12-22 18:30:41 +0100 <enikar> ah! yield in python is awesome
2024-12-22 18:30:05 +0100 <albet70> I found that 'yield' in python can do that
2024-12-22 18:29:35 +0100 <enikar> it's what I use
2024-12-22 18:29:24 +0100 <enikar> sinbad: use (string "\n\n")
2024-12-22 18:29:21 +0100 <albet70> ski , how you did it?
2024-12-22 18:29:20 +0100 <c_wraith> Those are the two main ways
2024-12-22 18:29:13 +0100 <c_wraith> And my day 17 parser: https://github.com/chowells79/aoc/blob/main/2024/Day17.hs#L33-L48 . It matches a series of lines including the terminal \n, then matches one more \n before the next section.
2024-12-22 18:27:49 +0100zenmov(~zenmov@user/zenmov) (Ping timeout: 272 seconds)
2024-12-22 18:26:22 +0100 <c_wraith> Here's my day 19 aoc parser. It literally matches (string "\n\n") at one point. https://github.com/chowells79/aoc/blob/main/2024/Day19.hs#L21-L31
2024-12-22 18:25:11 +0100 <probie> Assuming you already know the last line wasn't empty, perhaps something like `count 2 (char "\n") >> look >>= \case { ('\n':_) -> pfail; _ -> pure () }`
2024-12-22 18:24:48 +0100 <sinbad> c_wraith: yes I should have used \
2024-12-22 18:23:50 +0100 <c_wraith> Note that you need to be using backslashes (\) for escape codes, not forward slashes (/)
2024-12-22 18:23:23 +0100 <c_wraith> match the newlines in the stuff you care about. throw a (char '\n') parser between them.
2024-12-22 18:22:46 +0100 <c_wraith> Usually you approach it from the other direction
2024-12-22 18:13:33 +0100ash3en(~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 244 seconds)
2024-12-22 18:11:33 +0100 <sinbad> How can I parse an empty line ("/n/n") between non-empty lines using readP?
2024-12-22 18:10:54 +0100gmg(~user@user/gehmehgeh) gehmehgeh
2024-12-22 18:09:39 +0100toch(toch@user/toch) toch
2024-12-22 18:09:28 +0100sinbad(~sinbad@user/sinbad) Sinbad
2024-12-22 18:07:33 +0100toch(toch@user/toch) (Ping timeout: 248 seconds)
2024-12-22 18:07:02 +0100machinedgod(~machinedg@d108-173-18-100.abhsia.telus.net) machinedgod
2024-12-22 18:06:15 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2024-12-22 18:01:40 +0100tnt2tnt1
2024-12-22 18:01:40 +0100tnt1(~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
2024-12-22 18:01:32 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-12-22 18:00:33 +0100tnt2(~Thunderbi@user/tnt1) tnt1
2024-12-22 18:00:21 +0100rvalue(~rvalue@user/rvalue) rvalue
2024-12-22 17:59:50 +0100rvalue(~rvalue@user/rvalue) (Read error: Connection reset by peer)
2024-12-22 17:58:28 +0100 <ski> albet70 : btw, i literally did the "like it capture k1 inside f, then call g with k1, then capture g's rest as k2, it jumps to k1 with k2" thing, in Haskell, to do coroutines, to be able to jump back and forth between two parallel (and a priori independent) traversals of two data structures, combining their data "pointwise"/"coordinatewise"/"in lockstep"
2024-12-22 17:57:02 +0100Smiles(uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2024-12-22 17:56:19 +0100 <ski> albet70 : dunno whether it'd be reasonable with `async'. passing data (and not just the frozen control point) as "baton" back and forth between coroutines requires them to know about each other, or at least about the interface of the other(s), so would seem to assume synchronous communication
2024-12-22 17:55:03 +0100tnt2tnt1
2024-12-22 17:55:03 +0100tnt1(~Thunderbi@user/tnt1) (Ping timeout: 246 seconds)
2024-12-22 17:55:00 +0100tnt2(~Thunderbi@user/tnt1) tnt1