2026/06/28

Newest at the top

2026-06-28 12:35:48 +0000weary-traveler(~user@user/user363627) user363627
2026-06-28 12:35:12 +0000weary-traveler(~user@user/user363627) (Quit: Konversation terminated!)
2026-06-28 12:33:03 +0000 <fp> So without the cheat, it would've said "hi\n5\n"
2026-06-28 12:32:31 +0000rensenwxre(~fwam@user/fwam) fwam
2026-06-28 12:31:33 +0000 <fp> But actually I had to cheat with the first one. I couldn't reuse the x variable for the two >>s, so I rewrote put_str_ln("hi")
2026-06-28 12:30:24 +0000 <mauke> I suspect yours would give "hi\na\nb\nc\n"
2026-06-28 12:30:23 +0000 <fp> For the first one, it's "hi\n5hi\nhi"
2026-06-28 12:30:02 +0000 <mauke> the correct output is "3\nhi\nhi\n"
2026-06-28 12:29:22 +0000 <mauke> main = let { x :: IO (); x = putStrLn "hi" } in print (length [putStrLn "a", putStrLn "b", putStrLn "c"]) >> x >> x
2026-06-28 12:28:48 +0000 <mauke> actually, we can do better
2026-06-28 12:28:10 +0000 <mauke> not sure about lists
2026-06-28 12:28:06 +0000 <mauke> fn main() { let x = put_str_ln("hi"); print(???).bind(|_| { x.bind(|_| { x }) }); }
2026-06-28 12:26:38 +0000 <mauke> let me guess at the syntax
2026-06-28 12:26:08 +0000 <mauke> if you do the equivalent thing in rust, what does it output?
2026-06-28 12:25:49 +0000 <mauke> fp: main = let { x :: IO (); x = putStrLn "hi" } in print (length [x, x, x, x, x]) >> x >> x
2026-06-28 12:25:37 +0000 <fp> Sure, but I have to fake it a bit since I'm not interested in implementing the low level IO
2026-06-28 12:24:15 +0000 <mauke> (because 'return x >>= f' is 'f x')
2026-06-28 12:23:51 +0000 <mauke> IO::ret(s).bind(|s| { ... }) is pointless; could just { ... } directly
2026-06-28 12:23:12 +0000 <mauke> can't be right
2026-06-28 12:22:31 +0000 <fp> Of course, mine uses Rust std to do I/O instead of syscalls, but I'm interested in if the interface I've made is basically similar
2026-06-28 12:21:26 +0000 <fp> So I've been trying to get my head around how =IO= works, so I decided that I would try making a basic implementation of it with Rust. How far, at the high level, is what I'm doing from what Haskell does? https://paste.rs/SIL3v.rs
2026-06-28 12:20:28 +0000Lord_of_Life(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2026-06-28 12:18:58 +0000Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Read error: Connection reset by peer)
2026-06-28 12:16:23 +0000fp(~Thunderbi@178-133-117-157.mobile.vf-ua.net) fp
2026-06-28 12:14:54 +0000Lord_of_Life(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2026-06-28 12:11:53 +0000weary-traveler(~user@user/user363627) user363627
2026-06-28 11:58:08 +0000tremon(~tremon@83-80-159-219.cable.dynamic.v4.ziggo.nl) tremon
2026-06-28 11:50:15 +0000Digit(~user@user/digit) Digit
2026-06-28 11:44:45 +0000emilym(~Thunderbi@user/emilym) emilym
2026-06-28 11:43:55 +0000emilym(~Thunderbi@user/emilym) (Ping timeout: 276 seconds)
2026-06-28 11:35:56 +0000Digit`(~user@195.144.208.46.dyn.plus.net) (Ping timeout: 256 seconds)
2026-06-28 11:35:01 +0000Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Excess Flood)
2026-06-28 11:34:06 +0000Lord_of_Life_Lord_of_Life
2026-06-28 11:33:13 +0000vanishingideal(~vanishing@user/vanishingideal) (Ping timeout: 252 seconds)
2026-06-28 11:32:07 +0000Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
2026-06-28 11:31:14 +0000Lord_of_Life_(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2026-06-28 11:26:00 +0000skum(~skum@user/skum) skum
2026-06-28 11:11:22 +0000puke(~puke@user/puke) puke
2026-06-28 11:11:05 +0000puke(~puke@user/puke) (Read error: Connection reset by peer)
2026-06-28 11:10:45 +0000emilym(~Thunderbi@user/emilym) emilym
2026-06-28 11:09:04 +0000emilym(~Thunderbi@user/emilym) (Ping timeout: 245 seconds)
2026-06-28 11:08:52 +0000ft(~ft@p3e9bccce.dip0.t-ipconnect.de) ft
2026-06-28 11:02:51 +0000ft(~ft@p3e9bc25c.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2026-06-28 10:57:20 +0000ft(~ft@p3e9bc25c.dip0.t-ipconnect.de) ft
2026-06-28 10:56:39 +0000ft(~ft@p508db997.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
2026-06-28 10:51:27 +0000ft(~ft@p508db997.dip0.t-ipconnect.de) ft
2026-06-28 10:51:12 +0000Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2026-06-28 10:41:48 +0000emilym(~Thunderbi@user/emilym) emilym
2026-06-28 10:41:18 +0000berke93__(~default@82.166.36.177) (Ping timeout: 244 seconds)
2026-06-28 10:39:20 +0000ft(~ft@p4fc2a1bf.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)