2025/04/10

Newest at the top

2025-04-11 01:39:37 +0200 <EvanR> it amounted to a function returning a thing to pass to the next function, and a string to pass into that function
2025-04-11 01:39:19 +0200sayurc(~sayurc@169.150.203.34) (Read error: Connection reset by peer)
2025-04-11 01:39:09 +0200sayurc_(~sayurc@169.150.203.34) sayurc
2025-04-11 01:38:44 +0200 <EvanR> I didn't see the point of the Task datatype as stated
2025-04-11 01:38:21 +0200 <EvanR> it does not
2025-04-11 01:36:52 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
2025-04-11 01:36:49 +0200 <Guest87> EvanR: I think your Task type needs to be `String -> IO (Either String Task)` (assuming recursive `type` worked)
2025-04-11 01:35:48 +0200cipherrot(~znc-user@user/petrichor) (Ping timeout: 245 seconds)
2025-04-11 01:34:26 +0200 <EvanR> to get that a -> a -> a smaller
2025-04-11 01:34:16 +0200 <EvanR> and my posted code can probably be golfed with some pointfree compositions
2025-04-11 01:34:05 +0200L29Ah(~L29Ah@wikipedia/L29Ah) L29Ah
2025-04-11 01:32:49 +0200jleightcap(7bc4014b62@user/jleightcap) ()
2025-04-11 01:32:41 +0200 <EvanR> if it was just a bunch of IO actions in a list that needed to run, that's even less of a library, just sequence :: [IO a] -> IO [a]
2025-04-11 01:32:19 +0200hattckory(~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca)
2025-04-11 01:31:30 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-04-11 01:31:20 +0200 <lambdabot> Foldable t => (a -> a -> a) -> t a -> a
2025-04-11 01:31:19 +0200 <EvanR> :t foldl1
2025-04-11 01:30:26 +0200 <EvanR> but in general "Tasks" sounds like they'd be running concurrently and might need to communicate with each other, and the async library is pretty nice there
2025-04-11 01:30:02 +0200 <EvanR> hardly needs a library
2025-04-11 01:29:55 +0200 <EvanR> my paste is the entirety of the problem afaiui
2025-04-11 01:28:14 +0200 <Guest87> Are there any haskell libraries that implement whatever I am dealing with here? At one point I was re-learning the Cont monad, but this doesn't feel like Cont exactly
2025-04-11 01:27:21 +0200 <Guest87> xD I am just making things hard for myself I guess
2025-04-11 01:26:46 +0200 <EvanR> turning a non-empty [Task] into a Task using a Task -> Task -> Task... fairly "elegant" I'd say
2025-04-11 01:26:28 +0200peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 276 seconds)
2025-04-11 01:25:10 +0200 <Guest87> EvanR yup, this is easy to do with a list, I am just being a dummy and feel like using a list means I haven't figured out the elegant solution
2025-04-11 01:23:54 +0200xff0x(~xff0x@2405:6580:b080:900:1c0d:6c97:349e:6228)
2025-04-11 01:23:50 +0200L29Ah(~L29Ah@wikipedia/L29Ah) ()
2025-04-11 01:23:26 +0200 <EvanR> in my paste, addCont would simply be prepending another Task to the list
2025-04-11 01:21:16 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
2025-04-11 01:20:56 +0200 <EvanR> but since the code never runs in your case, that question doesn't need to be answered
2025-04-11 01:20:25 +0200 <EvanR> but there is no result
2025-04-11 01:20:12 +0200 <Guest87> Otherwise, Nothing means "nothing left to do"
2025-04-11 01:20:05 +0200 <Guest87> In `addCont`, Nothing is where I end up passing on the result to the next task
2025-04-11 01:19:59 +0200hattckory(~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca) (Ping timeout: 260 seconds)
2025-04-11 01:19:40 +0200xff0x(~xff0x@2405:6580:b080:900:1c0d:6c97:349e:6228) (Ping timeout: 265 seconds)
2025-04-11 01:19:06 +0200 <EvanR> well you return Nothing so what goes on to the next program
2025-04-11 01:18:48 +0200 <EvanR> Guest87, something like ... https://paste.tomsmeding.com/JF0HROx2
2025-04-11 01:18:39 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
2025-04-11 01:18:24 +0200 <Guest87> Yea for now I am assuming I at least have (Task "identityProgram" startingInput (\t -> return Nothing))
2025-04-11 01:18:14 +0200 <emojelly> I guess this is part of why people use effectful these days? But my usage of Coroutine specifically precludes effectful, I think.
2025-04-11 01:17:39 +0200 <EvanR> or is it never empty
2025-04-11 01:16:56 +0200 <EvanR> Guest87, question, what is the "empty list" of tasks supposed to do
2025-04-11 01:16:34 +0200 <emojelly> This is a bit of a bummer, because I was stupidly assuming that Monad Transformers were mostly "free" in terms of performance, at least in terms of just being part of the type, without much actual usage. But that does not seem to be the case at all. Even an IdentityT can wreak havoc if you e.g. fmap through it (i.e. actually follow transformer laws).
2025-04-11 01:16:16 +0200j1n37-(~j1n37@user/j1n37) (Ping timeout: 268 seconds)
2025-04-11 01:15:01 +0200j1n37(~j1n37@user/j1n37) j1n37
2025-04-11 01:14:55 +0200 <emojelly> My Monad/Monad Transformer, mixed in with the one from the test framework (Hedgehog), is quite an impressive layer of Coroutine, ExceptT, ReaderT, WriterT, Maybe, IdentityT... I know WriterT has a problem, but even if I try a more minimal example consisting just of Coroutine, IdentityT, and Either, just adding an IdentityT can make things multiple times slower.
2025-04-11 01:14:55 +0200hattckory(~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca)
2025-04-11 01:14:28 +0200 <EvanR> functions in haskell are blackboxes the only thing you do with them, other than pass them around, is apply them to an argument
2025-04-11 01:13:27 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-04-11 01:13:04 +0200 <Guest87> Is there a proper name/term for the problem I am running into when I do it all with one Task?