2026/04/06

Newest at the top

2026-04-06 13:29:10 +0000sonny(~sonny@bras-base-london140cw-grc-17-142-113-177-150.dsl.bell.ca) (Quit: Client closed)
2026-04-06 13:29:08 +0000terrorjack(~terrorjac@2a01:4f8:271:2d98::2) (Quit: The Lounge - https://thelounge.chat)
2026-04-06 13:28:41 +0000 <ski> (er, s/hGetChar/HGetChar/)
2026-04-06 13:28:30 +0000 <ski> you could write an interpreter, `runMyIO :: MyIO a -> IO a', for this
2026-04-06 13:28:07 +0000 <ski> and so on
2026-04-06 13:28:05 +0000 <ski> ...
2026-04-06 13:28:03 +0000 <ski> HPutChar :: Handle -> Char -> MyIO ()
2026-04-06 13:27:51 +0000 <ski> hGetChar :: Handle -> MyIO Char
2026-04-06 13:27:38 +0000 <ski> OpenFile :: FilePath -> IOMode -> MyIO Handle
2026-04-06 13:27:17 +0000 <ski> Bind :: MyIO a -> (a -> MyIO b) -> MyIO b
2026-04-06 13:27:04 +0000 <ski> Return :: a -> MyIO a
2026-04-06 13:26:58 +0000 <ski> where
2026-04-06 13:26:56 +0000 <ski> data MyIO :: * -> *
2026-04-06 13:26:31 +0000 <ski> if you want to, you could imagine a data type something like
2026-04-06 13:25:52 +0000 <ski> (for efficiency, it does get compiled, by GHC, to code that directly performs the indicated actions, rather than interpreting data structures)
2026-04-06 13:25:04 +0000 <ski> fp` : yes, you can think of it as a run-time that interprets the `IO'-action values, actually performing them
2026-04-06 13:25:01 +0000Square2(~Square@user/square) Square
2026-04-06 13:23:17 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
2026-04-06 13:17:51 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-06 13:16:44 +0000 <probie> `State# RealWorld` is a special 0-bit type that's just a token (since you can't actually pass the universe around), and the `(# ..., ... #)` is an "unboxed tuple", which you can think of as a strict tuple with no runtime overhead
2026-04-06 13:14:37 +0000 <probie> e.g. something of type `Char -> IO ()` is really `Char -> Universe -> ((), Universe)`, and the interface of the IO monad prevents you from using that `Universe` twice. In reality it's actually `Char -> State# RealWorld -> (# State# RealWorld, a #)`
2026-04-06 13:11:30 +0000 <probie> fp`: Something of type `IO a` is modelled by GHC as function from the current state of the universe, to a pair containing the new state of the universe, and a value of type `a`. As part of generating this "new state of the universe", IO actions happen
2026-04-06 13:07:31 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-04-06 13:06:26 +0000tromp(~textual@2001:1c00:340e:2700:8cf8:7bb7:a0e:7cfa) (Quit: My iMac has gone to sleep. ZZZzzz…)
2026-04-06 13:05:30 +0000 <fp`> So in the sense that `putChar 'c'` is evaluated to <IO action> and that is eventually executed to produce a 'c' in the tty, who does the executing? Is this a metaphor for how GHC produces code, or is there a runtime that is literally turning IO actions into syscalls?
2026-04-06 13:02:09 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-06 12:59:22 +0000oats(~oats@user/oats) oats
2026-04-06 12:59:08 +0000oats(~oats@user/oats) (Read error: Connection reset by peer)
2026-04-06 12:51:30 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-04-06 12:50:25 +0000tromp(~textual@2001:1c00:340e:2700:8cf8:7bb7:a0e:7cfa)
2026-04-06 12:48:53 +0000Lord_of_Life(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2026-04-06 12:47:30 +0000Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Excess Flood)
2026-04-06 12:46:20 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-06 12:45:42 +0000rainbyte(~rainbyte@181.47.219.3) rainbyte
2026-04-06 12:44:51 +0000rainbyte(~rainbyte@181.47.219.3) (Read error: Connection reset by peer)
2026-04-06 12:44:37 +0000Pixi`Pixi
2026-04-06 12:43:56 +0000sonny(~sonny@bras-base-london140cw-grc-17-142-113-177-150.dsl.bell.ca) sonny
2026-04-06 12:40:31 +0000chromoblob(~chromoblo@user/chromob1ot1c) (Ping timeout: 264 seconds)
2026-04-06 12:40:10 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-04-06 12:39:43 +0000Pozyomka(~pyon@user/pyon) pyon
2026-04-06 12:35:11 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-06 12:26:35 +0000m2(~travltux@user/travltux) travltux
2026-04-06 12:24:28 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-04-06 12:24:01 +0000m(~travltux@user/travltux) (Quit: WeeChat 4.7.2)
2026-04-06 12:19:08 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-04-06 12:14:46 +0000Pozyomka(~pyon@user/pyon) (Quit: brb)
2026-04-06 12:13:33 +0000craunts795335385(~craunts@152.32.99.2)
2026-04-06 12:10:08 +0000raelie(~raelie@user/raelie) raelie
2026-04-06 12:08:48 +0000TimWolla(~timwolla@2a01:4f8:150:6153:beef::6667) TimWolla
2026-04-06 12:08:29 +0000merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)