2026/06/08

Newest at the top

2026-06-08 14:58:24 +0000tv(~tv@user/tv) tv
2026-06-08 14:57:55 +0000tv(~tv@user/tv) (Ping timeout: 264 seconds)
2026-06-08 14:47:16 +0000 <lortabac> technically yes, but that module is not meant to be used directly
2026-06-08 14:46:59 +0000 <lortabac> it depends what you mean by "you can"
2026-06-08 14:45:35 +0000 <probie> janus: You can construct IO (in GHC Haskell). https://hackage-content.haskell.org/package/base-4.22.0.0/docs/GHC-IO.html#t:IO
2026-06-08 14:37:41 +0000bandola(~bandola@c-5eea53c4-74736162.cust.telenor.se) (Remote host closed the connection)
2026-06-08 14:37:39 +0000stephend(~stephend@2a06:61c1:77fc:0:9b71:2db5:cdef:4eb2) ()
2026-06-08 14:37:39 +0000 <janus> ski: i wonder if i am missing something, because for me, 'evaluating to the last pure' and 'evaluating to >>= and then repeating' seem equivalent. because there are no ways to contruct IO
2026-06-08 14:37:28 +0000stephend(~stephend@2a06:61c1:77fc:0:9b71:2db5:cdef:4eb2)
2026-06-08 14:34:20 +0000 <janus> ah right, if i replace the second unit with _, there is no crash
2026-06-08 14:34:19 +0000 <probie> Correct, but ignore me. I wrote my response before scrolling up to read the earlier conversation and it's therefore irrelevant
2026-06-08 14:33:14 +0000 <janus> probie: it should crash because you're matching on the unit no?
2026-06-08 14:32:31 +0000 <probie> janus: Try `traceM "hi" >>= \() -> pure undefined >>= \() -> pure ()`
2026-06-08 14:30:52 +0000CloneOfNone_(~CloneOfNo@user/CloneOfNone) (Ping timeout: 265 seconds)
2026-06-08 14:30:12 +0000weary-traveler(~user@user/user363627) user363627
2026-06-08 14:29:58 +0000CloneOfNone(~CloneOfNo@user/CloneOfNone) CloneOfNone
2026-06-08 14:29:56 +0000weary-traveler(~user@user/user363627) (Quit: Konversation terminated!)
2026-06-08 14:27:45 +0000 <ski> and yea, the monadic result value of `main' is ignored, so that `undefined' is never evaluated
2026-06-08 14:27:09 +0000 <ski> janus : after evaluation to WHNF, it executes the resulting `IO'-action, which may in turn trigger further execution (and dependent evaluation)
2026-06-08 14:26:13 +0000 <janus> and i run that program, i see "hi" but no exception
2026-06-08 14:26:00 +0000 <janus> if i do echo -e 'import Debug.Trace ; main = traceM "hi" >>= \() -> pure undefined' > /tmp/B.hs
2026-06-08 14:25:49 +0000 <janus> ski: how would it ever get beyond the first line of the 'do' notation the 'main' definition if it stops at the first >>=?
2026-06-08 14:25:36 +0000machinedgod(~machinedg@d172-219-48-230.abhsia.telus.net) machinedgod
2026-06-08 14:24:29 +0000xff0x(~xff0x@2405:6580:b080:900:7bda:8dd9:d259:e21b) (Ping timeout: 245 seconds)
2026-06-08 14:23:38 +0000gehmehgehgmg
2026-06-08 14:20:34 +0000chromoblob(~chromoblo@user/chromob1ot1c) chromoblob\0
2026-06-08 14:20:06 +0000chromoblob(~chromoblo@user/chromob1ot1c) (Read error: Connection reset by peer)
2026-06-08 14:19:01 +0000gmg(~user@user/gehmehgeh) (Ping timeout: 245 seconds)
2026-06-08 14:17:11 +0000gehmehgeh(~user@user/gehmehgeh) gehmehgeh
2026-06-08 14:12:15 +0000xff0x(~xff0x@2405:6580:b080:900:7bda:8dd9:d259:e21b)
2026-06-08 14:11:00 +0000 <ski> janus : "is evaluated until the last `pure`" -- not really. it would also stop at a `(>>=)'
2026-06-08 14:10:40 +0000epolanski(uid312403@id-312403.helmsley.irccloud.com) epolanski
2026-06-08 14:08:49 +0000ystael(~ystael@user/ystael) ystael
2026-06-08 14:07:05 +0000rekahsoft(~rekahsoft@2605:8d80:1520:40b8:7f13:d56c:3912:7b7a) (Ping timeout: 248 seconds)
2026-06-08 14:03:31 +0000 <janus> i suppose i could make an STGi program with a tuple construction, and then it shouldn't ever evaluated the 'a' thunk
2026-06-08 14:02:20 +0000 <janus> comerijn: ok, and 'pure' corresponds to the tuple constructor? because it crashes if the tuple is undefined, but it doesn't crash if the 'a' is undefined...
2026-06-08 13:57:46 +0000 <comerijn> janus: So at the STG level running IO/main is just a matter of "pass an argument, force the resulting tuple"
2026-06-08 13:57:21 +0000 <comerijn> janus: At the STG level `IO a` is just a function `RealWorld# -> (a, RealWorld#)` (where `RealWorld#` is a builtin in the compiler)
2026-06-08 13:52:57 +0000 <comerijn> i.e., that's the RTS' purview which is not constrained by the language definition
2026-06-08 13:52:43 +0000 <comerijn> janus: The evaluation of main is (conceptually) external to your code, though
2026-06-08 13:52:15 +0000xff0x(~xff0x@ai070051.d.east.v6connect.net) (Quit: xff0x)
2026-06-08 13:47:06 +0000tnt1(~Thunderbi@user/tnt1) tnt1
2026-06-08 13:45:21 +0000ouilemur(~jgmerritt@user/ouilemur) ouilemur
2026-06-08 13:41:07 +0000 <janus> probably not entirely true because as written, main is also evaluted even though it has no case
2026-06-08 13:39:59 +0000TwinAdam(~TwinAdam@user/adamsaunders) adamsaunders
2026-06-08 13:39:59 +0000 <janus> oh, the readme does say "Note that the WHNF part makes case strict, and indeed it is the only construct that does evaluation."
2026-06-08 13:38:43 +0000TwinAdam(~TwinAdam@user/adamsaunders) (Ping timeout: 264 seconds)
2026-06-08 13:34:01 +0000__monty__(~toonn@user/toonn) toonn
2026-06-08 13:31:49 +0000__monty__(~toonn@user/toonn) (Ping timeout: 244 seconds)
2026-06-08 13:27:44 +0000rekahsoft(~rekahsoft@2605:8d80:1520:40b8:7f13:d56c:3912:7b7a) rekahsoft