hoistStateIntoStateT
:: Sem (State s ': r) a
-> S.StateT s (Sem r) a
hoistStateIntoStateT (Sem m) = m $ \u ->
case decomp u of
Left x -> S.StateT $ \s ->
liftSem . fmap swap
. weave (s, ())
(\(s', m') -> fmap swap
$ S.runStateT m' s')
(Just . snd)
$ hoist hoistStateIntoStateT x
Right (Yo Get z _ y _) -> fmap (y . (<$ z)) $ S.get
Right (Yo (Put s) z _ y _) -> fmap (y . (<$ z)) $ S.put s
...
I definitely need to use my brain to read that code though.
...
...I definitely need to use my brain to read that code though.