ee1aeee5f8
It's beautiful how State is just Reader that returns a tuple of (a, r) instead of just a, allowing you to modify the environment (i.e. state). ```haskell newtype Reader r a = Reader { runReader :: r -> a } newtype State s a = State { runState :: s -> (a, s) } ``` |
||
---|---|---|
.. | ||
.ghci | ||
applicative.hs | ||
foldable.hs | ||
monad.hs | ||
reader.hs | ||
shell.nix | ||
state.hs | ||
traversable.hs |