Newest at the top
| 2025-12-11 22:06:32 +0100 | <monochrom> | You can furthermore omit the `lift` because ParsercT e s (Reader r) is an instance of MonadReader too. (Generally, ParsecT e s m, if m is an instance of MonadReader). |
| 2025-12-11 22:02:53 +0100 | <bwe> | Leary: wow, that's actually beautiful. |
| 2025-12-11 22:02:13 +0100 | jmcantrell_ | (~weechat@user/jmcantrell) jmcantrell |
| 2025-12-11 21:59:37 +0100 | Square2 | (~Square@user/square) (Ping timeout: 246 seconds) |
| 2025-12-11 21:57:41 +0100 | Pixi__ | (~Pixi@user/pixi) (Quit: Leaving) |
| 2025-12-11 21:56:42 +0100 | Square | (~Square4@user/square) Square |
| 2025-12-11 21:55:46 +0100 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) (Ping timeout: 246 seconds) |
| 2025-12-11 21:55:25 +0100 | <Leary> | bwe: I'm not sure what you're asking. Regardless, the way I'd actually recommend goes like so: https://play.haskell.org/saved/8oJlQyYR |
| 2025-12-11 21:51:04 +0100 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) |
| 2025-12-11 21:49:28 +0100 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection) |
| 2025-12-11 21:47:41 +0100 | Wygulmage | (~Wygulmage@user/Wygulmage) Wygulmage |
| 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 +0100 | AlexNoo | (~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 +0100 | humasect | (~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 +0100 | humasect | (~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" >:) |