2026/02/09

Newest at the top

2026-02-09 21:50:58 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-09 21:50:47 +0100 <c_wraith> I did some funny stuff faking dependent instances using a Reifies constraint. It works, but actual dependent types would be a lot easier to use.
2026-02-09 21:50:45 +0100peterbecich(~Thunderbi@71.84.33.135) (Ping timeout: 245 seconds)
2026-02-09 21:44:53 +0100 <c_wraith> Which has interesting UX considerations
2026-02-09 21:44:34 +0100 <c_wraith> functionally, the reflection library is also just "passing parameters", except it smuggles the parameter in a class constraint.
2026-02-09 21:44:03 +0100 <EvanR> which I guess has the proper name Implicit Configurations
2026-02-09 21:44:02 +0100KindFoxo(~KindFoxo@user/KindoFoxo) KindoFoxo
2026-02-09 21:43:56 +0100divlamir(~divlamir@user/divlamir) divlamir
2026-02-09 21:43:42 +0100KindFoxo(~KindFoxo@user/KindoFoxo) (Ping timeout: 265 seconds)
2026-02-09 21:43:36 +0100divlamir(~divlamir@user/divlamir) (Read error: Connection reset by peer)
2026-02-09 21:42:13 +0100 <EvanR> see also reflection (in haskell, for getting similar things accomplished)
2026-02-09 21:40:42 +0100 <c_wraith> Just for compatibility with different library versions renaming modules.
2026-02-09 21:40:27 +0100 <c_wraith> I actually use backpack features, but not for parameterized modules.
2026-02-09 21:40:10 +0100 <ncf> oh
2026-02-09 21:40:04 +0100 <dolio> backpack
2026-02-09 21:39:59 +0100 <c_wraith> Also, I guess it's more that *cabal* has them, and will modify the compilation environment to synthesize the equivalent.
2026-02-09 21:39:54 +0100 <ncf> does it?
2026-02-09 21:39:43 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2026-02-09 21:39:18 +0100 <c_wraith> technically Haskell has those, but they're so painful that no one uses them.
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!