2025/03/25

Newest at the top

2025-03-25 14:27:41 +0100 <tomsmeding> it's counterproductive to try to stretch it to its limits
2025-03-25 14:27:27 +0100 <tomsmeding> the physical analogy only goes so far
2025-03-25 14:27:00 +0100 <tomsmeding> and the "body" is on the right
2025-03-25 14:26:50 +0100 <tomsmeding> the "right-hand side" of `let x = a in b` is in the middle
2025-03-25 14:26:49 +0100 <EvanR> it's underneath that's for sure
2025-03-25 14:26:38 +0100kh0d(~kh0d@212.200.247.164) (Ping timeout: 245 seconds)
2025-03-25 14:26:30 +0100 <EvanR> or tower
2025-03-25 14:26:25 +0100 <EvanR> is the base inside or outside the building
2025-03-25 14:26:12 +0100 <EvanR> (I think)
2025-03-25 14:26:10 +0100 <EvanR> inside outside is also getting confused more when you get MonadBaseControl which calls the innermost "the base"
2025-03-25 14:25:56 +0100 <haskellbridge> <Liamzee> sorry
2025-03-25 14:25:18 +0100 <EvanR> the IO type wraps the product type yes, as far as the types go
2025-03-25 14:25:17 +0100 <tomsmeding> even if, operationally, things go weirdly inside out
2025-03-25 14:25:06 +0100 <tomsmeding> and as long as you keep the newtypes unexpanded, there's a clear outer/inner in your source text
2025-03-25 14:25:03 +0100 <EvanR> "IO wraps the pair" ok now I'm losing it with the burrito analogy, I feel like that might be off the farm
2025-03-25 14:24:52 +0100 <tomsmeding> Liamzee: I agree re ridiculousness of inside/outside, but the original question was about intuition about monad transformer stacks _without_ expanding their definitions
2025-03-25 14:24:40 +0100CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 244 seconds)
2025-03-25 14:24:33 +0100 <haskellbridge> <Liamzee> then IO wraps the output (a, s) pair
2025-03-25 14:24:22 +0100 <tomsmeding> > newtype StateT s m a = StateT { runStateT :: s -> m (a,s) }
2025-03-25 14:24:17 +0100 <haskellbridge> <Liamzee> you have a data dependency on state
2025-03-25 14:24:14 +0100 <EvanR> s -> (a, IO s)
2025-03-25 14:24:12 +0100 <haskellbridge> <Liamzee> how ridiculous the notion of outside and inside can be with some of these monad transformers
2025-03-25 14:24:10 +0100 <EvanR> I guess we need to complete all the possibilities
2025-03-25 14:23:54 +0100 <haskellbridge> <Liamzee> i just came up with some nonsense versions to try to illustrate
2025-03-25 14:23:48 +0100 <tomsmeding> lambdabot just expands the newtypes
2025-03-25 14:23:40 +0100 <EvanR> oh it's two versions from Liamzee
2025-03-25 14:23:32 +0100 <haskellbridge> <Liamzee> it's lambdabot
2025-03-25 14:23:29 +0100 <tomsmeding> to wit, neither of the options that Liamzee just gave are particularly useful in practice
2025-03-25 14:23:24 +0100 <EvanR> is the real version of StateT s IO a more like lambdabot or more like Liamzee
2025-03-25 14:22:59 +0100 <tomsmeding> that's up to the blog post writer
2025-03-25 14:22:45 +0100 <haskellbridge> <Liamzee> in the case provided by lambdabot, is IO beneath state or is state beneath IO?
2025-03-25 14:22:22 +0100 <haskellbridge> <Liamzee> IO (s -> (a, s)), s -> (IO a, s)
2025-03-25 14:22:04 +0100 <EvanR> IO is the crunchy outer layer of the purely functional program burrito, so it's just that the "stack" is upside down
2025-03-25 14:21:43 +0100 <haskellbridge> <Liamzee> ummmm
2025-03-25 14:21:23 +0100 <tomsmeding> see, if you just write out `s -> IO (a, s)` all is clear
2025-03-25 14:20:59 +0100 <lambdabot> s -> IO (a, s)
2025-03-25 14:20:59 +0100 <tomsmeding> @unmtl StateT s IO a
2025-03-25 14:20:55 +0100 <tomsmeding> EvanR: case in point why burritos are not appropriate here: if you have StateT s IO a, then even though IO is arguably the "inner" monad here, it's actually the IO burrito that contains the State burrito
2025-03-25 14:20:14 +0100 <haskellbridge> <Liamzee> actually, StateT case is sort of confused, no?
2025-03-25 14:16:51 +0100 <Leary> Yes, it's just a little higher-order tweak on the same idea.
2025-03-25 14:16:14 +0100 <int-e> each value can come with its own m
2025-03-25 14:15:58 +0100 <int-e> oh nm
2025-03-25 14:15:46 +0100 <EvanR> the innermost layer of burritos can't be reset
2025-03-25 14:15:21 +0100 <tomsmeding> okay that last was "inner"
2025-03-25 14:15:10 +0100 <tomsmeding> oh I see
2025-03-25 14:14:57 +0100 <EvanR> scroll up lol
2025-03-25 14:14:55 +0100 <int-e> Leary: but I see what you mean
2025-03-25 14:14:53 +0100 <tomsmeding> EvanR: no one said "last" here
2025-03-25 14:14:52 +0100 <EvanR> "innermost"
2025-03-25 14:14:46 +0100 <int-e> Leary: hmm the example looks dubious (where does m come from?)