4 ms·
hoistStateIntoStateT :: Sem (State s ': r) a -> S.StateT s (Sem r) a ? Sorry even that'll get my brain CPU on 100% for a few minutes.
by quickthrower2 7y ago
hoistStateIntoStateT
:: Sem (State s ': r) a
-> S.StateT s (Sem r) a
?
Sorry even that'll get my brain CPU on 100% for a few minutes.
- lalaithion 7y agoThis code takes a Sem monad with a State effect in it, and turns it into a StateT monad with an inner monad of Sem and al l the other effects. I have never user Polysemy, any effects library, or type-level lists before, but I'm reasonably sure my guess is right, despite not understanding any of the code.
- tathougies 7y agoTakes a Sem with a state effect and turns it into the state monad transformer over Sem with the remaining effects?
- nilkn 7y agoI suspect you probably just need more experience with the base language. And I don't mean that in a bad way -- Haskell is a bit of a weird language, and it's something that you'll need to spend some time with. But indeed that's a fairly standard sort of type signature that you'll process at a glance if you've used the language a fair bit.