Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2020-07-01 | Complete exercises for Reader and State chapters | William Carroll | 1 | -0/+149 | |
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) } ``` |