2026/02/09

Newest at the top

2026-02-09 21:37:29 +0100 <ncf> i guess this is only necessary in a language without parametrised modules..
2026-02-09 21:34:58 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-09 21:34:29 +0100 <c_wraith> There are a lot of ways to do this, of course. But a single indirect function call is very low weight, compared to a lot of abstractions you can come up with.
2026-02-09 21:32:01 +0100 <c_wraith> They key point is that you've abstracted managing the log system away from the logic that actually sends messages to the log system.
2026-02-09 21:31:08 +0100 <c_wraith> It's not necessarily continuations. You can pass around `log :: Env -> Level -> Message -> M ()' and there's no continuations there.
2026-02-09 21:31:07 +0100 <EvanR> https://academy.fpblock.com/blog/2017/06/readert-design-pattern/
2026-02-09 21:30:11 +0100 <ncf> sounds like that's what this is, unless i'm misunderstanding what it is people call the "ReaderT pattern"
2026-02-09 21:29:45 +0100 <EvanR> if your dependencies are continuations
2026-02-09 21:29:27 +0100 <ncf> although maybe continuation-passing would be a better name for this
2026-02-09 21:29:14 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2026-02-09 21:29:13 +0100 <EvanR> I was going to say, if it boils down to passing the arguments you need, there's very little wiggle room to do anything else in haskell
2026-02-09 21:29:05 +0100 <ncf> if you mean dependency injection say dependency injection!
2026-02-09 21:28:53 +0100 <c_wraith> the type checker gets upset when you don't pass enough parameters.
2026-02-09 21:28:34 +0100 <EvanR> don't forget to inject your dependencies
2026-02-09 21:27:27 +0100 <c_wraith> Dependency injection is very natural in haskell. It's an overly formal name for "pass parameters", but it's very good to think about doing.
2026-02-09 21:26:47 +0100 <ncf> can we not java-fy haskell thanks
2026-02-09 21:26:26 +0100 <ncf> seems like a very silly name
2026-02-09 21:24:37 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-02-09 21:24:32 +0100KindFoxo(~KindFoxo@user/KindoFoxo) KindoFoxo
2026-02-09 21:24:21 +0100 <c_wraith> There is something people call the "ReaderT pattern" which is not just "this is what ReaderT does". It's about designing your program around a kind of dependency injection in the form of actions being passed around implicitly with ReaderT
2026-02-09 21:24:12 +0100KindFoxo(~KindFoxo@user/KindoFoxo) (Read error: Connection reset by peer)
2026-02-09 21:23:02 +0100sord937(~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
2026-02-09 21:21:40 +0100 <s3np41> will read thanks
2026-02-09 21:21:05 +0100 <ncf> if you want an introduction to monad transformers in general then https://en.wikibooks.org/wiki/Haskell/Monad_transformers
2026-02-09 21:20:20 +0100 <EvanR> there do be those there
2026-02-09 21:20:00 +0100 <s3np41> Thanks anyways
2026-02-09 21:19:53 +0100 <s3np41> well i just wanted to get good examples, so i guess the hackage should suffice?
2026-02-09 21:19:08 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-09 21:18:16 +0100bggd_(~bgg@2a01:e0a:fd5:f510:870e:b6e1:18ac:1926) (Remote host closed the connection)
2026-02-09 21:17:57 +0100 <EvanR> but going further and making the mtl and transformers API more abstract... there's SPJ's paper listed on the haddocks
2026-02-09 21:17:48 +0100 <ncf> even has examples!
2026-02-09 21:17:37 +0100 <ncf> it's not a pattern, it's a monad transformer, and https://hackage-content.haskell.org/package/mtl-2.3.2/docs/Control-Monad-Reader.html
2026-02-09 21:17:22 +0100peterbecich(~Thunderbi@71.84.33.135) peterbecich
2026-02-09 21:17:14 +0100 <EvanR> there's not much to say about ReaderT itself, which transforms any monad to one with an additional read only context, which you can fully get by writing one yourself
2026-02-09 21:15:09 +0100AlexNoo_AlexNoo
2026-02-09 21:14:19 +0100 <s3np41> Anyone knows of good resources to read up on the ReaderT pattern?
2026-02-09 21:12:40 +0100peterbecich(~Thunderbi@71.84.33.135) (Ping timeout: 255 seconds)
2026-02-09 21:11:29 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) humasect
2026-02-09 21:11:09 +0100s3np41(~s3np41@078088254000.unknown.vectranet.pl)
2026-02-09 21:09:33 +0100messewix(~jmc@user/messewix) messewix
2026-02-09 21:08:25 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-02-09 21:03:58 +0100peterbecich(~Thunderbi@71.84.33.135) peterbecich
2026-02-09 21:01:06 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-09 20:57:44 +0100machinedgod(~machinedg@d75-159-126-101.abhsia.telus.net) (Ping timeout: 244 seconds)
2026-02-09 20:50:32 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2026-02-09 20:45:19 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-09 20:45:16 +0100Lord_of_Life_Lord_of_Life
2026-02-09 20:44:26 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds)
2026-02-09 20:43:56 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915) Lord_of_Life
2026-02-09 20:34:58 +0100DetourNetworkUK(~DetourNet@user/DetourNetworkUK) DetourNetworkUK