Comment

Comment by quickthrower2

> I don't need to use my brain to do programming

...

    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.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton