Logs: liberachat/#haskell
| 2025-12-11 18:30:24 | × | spew quits (~spew@user/spew) (Quit: WeeChat 4.7.2) |
| 2025-12-11 18:31:10 | × | pabs3 quits (~pabs3@user/pabs3) (Ping timeout: 245 seconds) |
| 2025-12-11 18:36:55 | × | raym quits (~ray@user/raym) (Ping timeout: 240 seconds) |
| 2025-12-11 18:38:35 | → | raym joins (~ray@user/raym) |
| 2025-12-11 18:42:04 | × | kuribas quits (~user@2a02:1808:cd:df9d:1dcb:cff3:20e8:95d8) (Ping timeout: 246 seconds) |
| 2025-12-11 18:43:13 | × | peterbecich quits (~Thunderbi@71.84.33.135) (Ping timeout: 264 seconds) |
| 2025-12-11 18:43:27 | × | marinelli quits (~weechat@gateway/tor-sasl/marinelli) (Ping timeout: 252 seconds) |
| 2025-12-11 18:45:22 | → | pabs3 joins (~pabs3@user/pabs3) |
| 2025-12-11 18:45:28 | → | marinelli joins (~weechat@gateway/tor-sasl/marinelli) |
| 2025-12-11 18:50:57 | × | __monty__ quits (~toonn@user/toonn) (Ping timeout: 256 seconds) |
| 2025-12-11 18:57:06 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 2025-12-11 18:57:28 | × | omidmash quits (~omidmash@user/omidmash) (Quit: The Lounge - https://thelounge.chat) |
| 2025-12-11 18:58:38 | → | califax joins (~califax@user/califx) |
| 2025-12-11 19:01:02 | × | Googulator quits (~Googulato@87-97-86-146.pool.digikabel.hu) (Quit: Client closed) |
| 2025-12-11 19:01:09 | → | Googulator joins (~Googulato@87-97-86-146.pool.digikabel.hu) |
| 2025-12-11 19:01:30 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 2025-12-11 19:02:25 | → | califax joins (~califax@user/califx) |
| 2025-12-11 19:03:05 | → | omidmash joins (~omidmash@user/omidmash) |
| 2025-12-11 19:03:48 | × | tromp quits (~textual@2001:1c00:3487:1b00:dd4:56d:fd02:60e2) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2025-12-11 19:05:36 | × | ss4 quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
| 2025-12-11 19:06:47 | → | kuribas joins (~user@2a02:1808:cd:df9d:3fd8:99c:a12:7c8) |
| 2025-12-11 19:14:21 | → | __monty__ joins (~toonn@user/toonn) |
| 2025-12-11 19:15:43 | × | tabaqui1 quits (~tabaqui@167.71.80.236) (Ping timeout: 240 seconds) |
| 2025-12-11 19:16:49 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 264 seconds) |
| 2025-12-11 19:20:28 | × | yin quits (~zero@user/zero) (Remote host closed the connection) |
| 2025-12-11 19:23:36 | → | merijn joins (~merijn@77.242.116.146) |
| 2025-12-11 19:24:40 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 2025-12-11 19:24:49 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 2025-12-11 19:29:00 | → | tabaqui joins (~tabaqui@167.71.80.236) |
| 2025-12-11 19:30:48 | → | Googulator58 joins (~Googulato@2a01-036d-0106-01cb-8583-2a78-a55c-bee5.pool6.digikabel.hu) |
| 2025-12-11 19:30:51 | × | Googulator quits (~Googulato@87-97-86-146.pool.digikabel.hu) (Quit: Client closed) |
| 2025-12-11 19:31:28 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 2025-12-11 19:31:46 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 246 seconds) |
| 2025-12-11 19:32:48 | Lord_of_Life_ | is now known as Lord_of_Life |
| 2025-12-11 19:35:59 | → | califax joins (~califax@user/califx) |
| 2025-12-11 19:42:30 | × | vetkat quits (~vetkat@user/vetkat) (Read error: Connection reset by peer) |
| 2025-12-11 19:42:53 | → | vetkat joins (~vetkat@user/vetkat) |
| 2025-12-11 19:46:27 | → | humasect joins (~humasect@dyn-192-249-132-90.nexicom.net) |
| 2025-12-11 19:47:07 | → | CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) |
| 2025-12-11 19:50:31 | × | polykernel quits (~polykerne@user/polykernel) (Remote host closed the connection) |
| 2025-12-11 19:50:59 | → | polykernel joins (~polykerne@user/polykernel) |
| 2025-12-11 19:57:33 | <bwe> | Reader & ReaderT: I've now grasped the concept of hiding an (read only) input argument within Reader. Also it's straightforward to have a nested structure of functions that propagate this way the argument to the terminal function. What causes frustration right now is: `ReaderT ReadArg Parser Result` when is which bind operator (`<-`) working in which context (and what does it expect), i.e. ReaderT or Parser? -- Can you recommend a tutorial / paper that wal |
| 2025-12-11 19:57:33 | <bwe> | ks through some examples of this kind? |
| 2025-12-11 19:59:18 | <haskellbridge> | <Zemyla> It's operating in the Reader context, and if you want to run a Parser value, you need to lift it. |
| 2025-12-11 19:59:33 | <haskellbridge> | <Zemyla> Or else use a typeclass that lifts it automatically. |
| 2025-12-11 20:00:33 | <bwe> | Zemyla: Do I want in this case something like `liftIO` but for Reader context? |
| 2025-12-11 20:02:40 | <c_wraith> | :t lift |
| 2025-12-11 20:02:41 | <lambdabot> | (MonadTrans t, Monad m) => m a -> t m a |
| 2025-12-11 20:03:08 | <c_wraith> | that's... the *sole* operation specific to monad transformers |
| 2025-12-11 20:03:54 | → | jmcantrell_ joins (~weechat@user/jmcantrell) |
| 2025-12-11 20:03:59 | <bwe> | lift ... then is adding another layer of Reader to Parser so it matches up to the expected type |
| 2025-12-11 20:04:52 | ← | kuribas parts (~user@2a02:1808:cd:df9d:3fd8:99c:a12:7c8) (ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)) |
| 2025-12-11 20:04:59 | <c_wraith> | there are some rules it must follow.. lift a >>= \x -> lift (f x) must be equivalent to lift (a >>= \x -> f x) |
| 2025-12-11 20:05:12 | <c_wraith> | that's really the only rule you need, actually |
| 2025-12-11 20:08:26 | → | Square2 joins (~Square@user/square) |
| 2025-12-11 20:09:03 | <bwe> | Ok, thanks, that instantly relieves me of some frustration if I use that in my code. -- Then, what's the confusion about transformer libraries? There's one I am warned about whereas I should use the other. What's true? |
| 2025-12-11 20:09:20 | <monochrom> | To a large extent, ReaderT makes more sense if you follow Typeclassopedia in reinventing ReaderT from scratch (or any of those transformers). |
| 2025-12-11 20:11:06 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds) |
| 2025-12-11 20:11:43 | <bwe> | Oh, I meant https://hackage.haskell.org/package/mtl vs. https://hackage.haskell.org/package/transformers |
| 2025-12-11 20:11:56 | <c_wraith> | the funny thing is there is no argument there. |
| 2025-12-11 20:12:01 | trickard_ | is now known as trickard |
| 2025-12-11 20:12:11 | <c_wraith> | the argument is between mtl and monads-tf. mtl won. |
| 2025-12-11 20:12:29 | <c_wraith> | transformers was created to share as much code as possible between mtl and monads-tf |
| 2025-12-11 20:12:51 | <c_wraith> | transformers has all the actual implementations |
| 2025-12-11 20:13:05 | <c_wraith> | mtl provides a slightly different API for them |
| 2025-12-11 20:13:14 | <monochrom> | Yeah you must have been reading very outdated material. There was a divide two decades ago. They were unified since then. |
| 2025-12-11 20:13:35 | <bwe> | That's interesting to learn. So my default is then any or just mtl? |
| 2025-12-11 20:13:56 | <c_wraith> | I'm still mildly in favor of using transformers without the mtl layer, but I'm unconcerned. I'll go either way for compatibility |
| 2025-12-11 20:14:00 | <monochrom> | Today, transformers defines ReaderT, and mtl defines the MonadReader class and puts ReaderT as an instance. That is all. |
| 2025-12-11 20:14:14 | <monochrom> | (and mtl re-exports transformers) |
| 2025-12-11 20:14:55 | × | jmcantrell_ quits (~weechat@user/jmcantrell) (Ping timeout: 240 seconds) |
| 2025-12-11 20:15:48 | → | Googulator22 joins (~Googulato@2a01-036d-0106-01cb-8583-2a78-a55c-bee5.pool6.digikabel.hu) |
| 2025-12-11 20:15:48 | × | Googulator58 quits (~Googulato@2a01-036d-0106-01cb-8583-2a78-a55c-bee5.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-11 20:16:43 | <dolio> | At some point mtl had everything directly in it, and then there were a couple of split up packages on top of transformers. But eventually mtl just got turned into essentially the same thing as the fundeps one. |
| 2025-12-11 20:17:09 | <dolio> | Because it was silly having 3 things like mtl. |
| 2025-12-11 20:17:41 | <bwe> | monochrom: that's complicated enough :) |
| 2025-12-11 20:18:22 | <monochrom> | I used to tell fake news about it in the form of "Vienna Peace Conference established the Concert of MTL" >:) |
| 2025-12-11 20:18:35 | <bwe> | https://play.haskell.org/saved/CIlt9hCq <- what's the right approach to mix Reader and non Reader parsers? I mean line 4. |
| 2025-12-11 20:19:23 | <monochrom> | I thought you knew about `lift`? |
| 2025-12-11 20:19:59 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection) |
| 2025-12-11 20:20:00 | <mauke> | why is there a runReaderT in there? |
| 2025-12-11 20:20:26 | <monochrom> | I believe it is to reinvent `lift`. :) |
| 2025-12-11 20:20:35 | <bwe> | mauke: because parserB and parser C are of type `Parser Result` |
| 2025-12-11 20:20:52 | <mauke> | parserA <|> lift parserB <|> lift parserC ? |
| 2025-12-11 20:21:20 | <monochrom> | Although, can you still use <|> at the ReaderT level? |
| 2025-12-11 20:21:28 | <bwe> | okay, the thing then is that my working context is already ReaderT |
| 2025-12-11 20:21:30 | <monochrom> | Ah probably yes. |
| 2025-12-11 20:22:15 | <EvanR> | ReaderT, (one of) haskell's (many) answers to dependency injection |
| 2025-12-11 20:24:20 | <c_wraith> | dependency injection is such a complicated name for "pass values around" |
| 2025-12-11 20:26:28 | <EvanR> | haha |
| 2025-12-11 20:26:50 | <monochrom> | I would say "higher-order functions" but OK! |
| 2025-12-11 20:27:13 | <EvanR> | the dependency may not be a function |
| 2025-12-11 20:27:34 | <monochrom> | <facetious> "callback" is a complicated way to say "continuation" </facectious> |
| 2025-12-11 20:28:04 | <dolio> | I don't know which of those deserves to be considered more complicated. |
| 2025-12-11 20:28:07 | <mauke> | lower-chrer |
| 2025-12-11 20:28:29 | <EvanR> | dependency itself is kind a can of worms |
| 2025-12-11 20:28:38 | <EvanR> | evokes a lot of infrastructure |
| 2025-12-11 20:29:06 | <EvanR> | but here it boils down to, this express has free variables. But we're calling it a dependency |
| 2025-12-11 20:29:11 | <EvanR> | expression |
| 2025-12-11 20:32:14 | <monochrom> | Oh! Then "lambda lifting" :) |
All times are in UTC.