2025/12/11

Newest at the top

2025-12-11 21:45:32 +0100 <bwe> Leary: …you do that with `k (`runReaderT` r)` right?
2025-12-11 21:40:10 +0100 <Leary> bwe: Re mixing levels, this <https://play.haskell.org/saved/vdNe7NSH> is one option, but you're probably better off reversing the order of `ReaderT` and `ParsecT`, since that way the only operation you need to `lift` is `ask`.
2025-12-11 21:38:10 +0100AlexNoo(~AlexNoo@85.174.180.40)
2025-12-11 21:36:40 +0100 <lambdabot> Applicative f => (a1 -> f a2) -> [a1] -> f [a2]
2025-12-11 21:36:39 +0100 <mauke> :t \f -> sequenceA . map f
2025-12-11 21:36:18 +0100 <lambdabot> Monad m => (a1 -> m a2) -> [a1] -> m [a2]
2025-12-11 21:36:18 +0100 <mauke> :t \f -> sequence . map f
2025-12-11 21:35:40 +0100 <bwe> My intuition led me to traverse :).
2025-12-11 21:35:12 +0100 <lambdabot> (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
2025-12-11 21:35:11 +0100 <mauke> :t traverse
2025-12-11 21:35:01 +0100 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
2025-12-11 21:35:00 +0100 <mauke> :t sequence
2025-12-11 21:33:43 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) humasect
2025-12-11 21:32:58 +0100 <monochrom> Does `sequence` do what you want?
2025-12-11 21:32:25 +0100 <bwe> f xs = (_ . map returnsSomeReader $ xs) :: [Text] -> Reader Config [Result] -- how do I transform [Reader Config Result] to `Reader Config [Result]`?
2025-12-11 21:32:14 +0100 <monochrom> Oh! Then "lambda lifting" :)
2025-12-11 21:29:11 +0100 <EvanR> expression
2025-12-11 21:29:06 +0100 <EvanR> but here it boils down to, this express has free variables. But we're calling it a dependency
2025-12-11 21:28:38 +0100 <EvanR> evokes a lot of infrastructure
2025-12-11 21:28:29 +0100 <EvanR> dependency itself is kind a can of worms
2025-12-11 21:28:07 +0100 <mauke> lower-chrer
2025-12-11 21:28:04 +0100 <dolio> I don't know which of those deserves to be considered more complicated.
2025-12-11 21:27:34 +0100 <monochrom> <facetious> "callback" is a complicated way to say "continuation" </facectious>
2025-12-11 21:27:13 +0100 <EvanR> the dependency may not be a function
2025-12-11 21:26:50 +0100 <monochrom> I would say "higher-order functions" but OK!
2025-12-11 21:26:28 +0100 <EvanR> haha
2025-12-11 21:24:20 +0100 <c_wraith> dependency injection is such a complicated name for "pass values around"
2025-12-11 21:22:15 +0100 <EvanR> ReaderT, (one of) haskell's (many) answers to dependency injection
2025-12-11 21:21:30 +0100 <monochrom> Ah probably yes.
2025-12-11 21:21:28 +0100 <bwe> okay, the thing then is that my working context is already ReaderT
2025-12-11 21:21:20 +0100 <monochrom> Although, can you still use <|> at the ReaderT level?
2025-12-11 21:20:52 +0100 <mauke> parserA <|> lift parserB <|> lift parserC ?
2025-12-11 21:20:35 +0100 <bwe> mauke: because parserB and parser C are of type `Parser Result`
2025-12-11 21:20:26 +0100 <monochrom> I believe it is to reinvent `lift`. :)
2025-12-11 21:20:00 +0100 <mauke> why is there a runReaderT in there?
2025-12-11 21:19:59 +0100humasect(~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2025-12-11 21:19:23 +0100 <monochrom> I thought you knew about `lift`?
2025-12-11 21:18:35 +0100 <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 21:18:22 +0100 <monochrom> I used to tell fake news about it in the form of "Vienna Peace Conference established the Concert of MTL" >:)
2025-12-11 21:17:41 +0100 <bwe> monochrom: that's complicated enough :)
2025-12-11 21:17:09 +0100 <dolio> Because it was silly having 3 things like mtl.
2025-12-11 21:16:43 +0100 <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 21:15:48 +0100Googulator58(~Googulato@2a01-036d-0106-01cb-8583-2a78-a55c-bee5.pool6.digikabel.hu) (Quit: Client closed)
2025-12-11 21:15:48 +0100Googulator22(~Googulato@2a01-036d-0106-01cb-8583-2a78-a55c-bee5.pool6.digikabel.hu)
2025-12-11 21:14:55 +0100jmcantrell_(~weechat@user/jmcantrell) (Ping timeout: 240 seconds)
2025-12-11 21:14:14 +0100 <monochrom> (and mtl re-exports transformers)
2025-12-11 21:14:00 +0100 <monochrom> Today, transformers defines ReaderT, and mtl defines the MonadReader class and puts ReaderT as an instance. That is all.
2025-12-11 21:13:56 +0100 <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 21:13:35 +0100 <bwe> That's interesting to learn. So my default is then any or just mtl?
2025-12-11 21:13:14 +0100 <monochrom> Yeah you must have been reading very outdated material. There was a divide two decades ago. They were unified since then.