2025/11/25

Newest at the top

2025-11-25 22:25:04 +0100 <hseg> ... ah, that's why you wrote fmap .. $ and not <$> -- precedence
2025-11-25 22:21:52 +0100 <hseg> (probably because there are some differences between what I pasted and what I wrote)
2025-11-25 22:21:46 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-25 22:21:29 +0100 <hseg> ... for some reason it's not working when I paste it into the actual code -- ghc doesn't think this typechecks?
2025-11-25 22:21:09 +0100 <tomsmeding> I very rarely use MaybeT so I also had to double-check that it does the right thing
2025-11-25 22:11:19 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-25 22:10:52 +0100target_i(~target_i@user/target-i/x-6023099) (Quit: leaving)
2025-11-25 22:10:34 +0100 <hseg> it's been a while, am a little rusty
2025-11-25 22:10:31 +0100 <tomsmeding> (because it chooses based on the Maybe, not based on monadic state in m)
2025-11-25 22:10:19 +0100 <hseg> ah, excellent
2025-11-25 22:10:01 +0100 <tomsmeding> but 'MaybeT m' is Alternative regardless of m, as long as m implements Monad
2025-11-25 22:09:49 +0100 <tomsmeding> yes
2025-11-25 22:09:43 +0100 <hseg> on MaybeT IO?
2025-11-25 22:09:06 +0100 <tomsmeding> this asum uses <|> on MaybeT
2025-11-25 22:08:42 +0100 <tomsmeding> Leary: hseg: like this? https://play.haskell.org/saved/C0K0rs9c
2025-11-25 22:07:46 +0100 <hseg> problem. Shake.Action is not an Alternative
2025-11-25 22:07:34 +0100 <[exa]> but no need for transformers
2025-11-25 22:07:10 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-25 22:07:09 +0100 <[exa]> yeah it feels dirty
2025-11-25 22:06:03 +0100 <[exa]> (IO is Alternative)
2025-11-25 22:06:00 +0100 <tomsmeding> doing it with IO exceptions feels ugly
2025-11-25 22:05:37 +0100 <[exa]> it crashes but <|> saves
2025-11-25 22:05:28 +0100 <hseg> wait, won't Just env <- getEnv crash if the envvar is unset?
2025-11-25 22:05:05 +0100 <[exa]> (otoh yeah MaybeT is the clean way)
2025-11-25 22:04:50 +0100 <[exa]> in IO you can just bind to `Just env <- getEnv` and return the env in 2 alternatives, no need to do MaybeT
2025-11-25 22:04:35 +0100 <hseg> am getting a little confused with the tower of monads I'm using here
2025-11-25 22:04:23 +0100 <tomsmeding> yes and then end with `maybe default return =<<`
2025-11-25 22:03:44 +0100 <tomsmeding> https://hackage.haskell.org/package/transformers-0.6.1.1/docs/src/Control.Monad.Trans.Maybe.html#l…
2025-11-25 22:03:01 +0100 <Leary> Rather, `<|>` on `MaybeT IO`.
2025-11-25 22:02:57 +0100 <tomsmeding> so what about the IO
2025-11-25 22:02:52 +0100 <hseg> Maybe
2025-11-25 22:02:46 +0100 <tomsmeding> what's f here?
2025-11-25 22:02:42 +0100 <lambdabot> (Foldable t, Alternative f) => t (f a) -> f a
2025-11-25 22:02:41 +0100 <tomsmeding> :t asum
2025-11-25 22:02:17 +0100 <geekosaur> asum?
2025-11-25 22:01:59 +0100Frostillicus(~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-11-25 22:01:34 +0100Frostillicus(~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 246 seconds)
2025-11-25 22:00:12 +0100 <hseg> the idea is to try two different ways of computing a monadic result, returning the first among them that doesn't result in m Nothing along the way, with a default
2025-11-25 21:59:16 +0100 <hseg> my brain is a little too fried for this -- how do I cleanly write https://0x0.st/KWE8.txt ?
2025-11-25 21:58:25 +0100tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net)
2025-11-25 21:56:33 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2025-11-25 21:54:35 +0100vanishingideal(~vanishing@user/vanishingideal) (Ping timeout: 240 seconds)
2025-11-25 21:51:46 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-25 21:42:12 +0100vanishingideal(~vanishing@user/vanishingideal) vanishingideal
2025-11-25 21:40:35 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-11-25 21:40:09 +0100 <tomsmeding> but nice :)
2025-11-25 21:40:06 +0100 <tomsmeding> Wygulmage: protip: use tab-completion for nicks, mentioning doesn't work if there's a typo :)
2025-11-25 21:36:17 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-11-25 21:34:27 +0100Frostillicus(~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net)
2025-11-25 21:33:03 +0100 <Wygulmage> tomsmedding: Sorry for the belated answer. Thank you. `.&&.` is exactly what I wanted.