about summary refs log tree commit diff
path: root/scratch/haskell-programming-from-first-principles/reader.hs
AgeCommit message (Collapse)AuthorFilesLines
2020-07-01 Complete exercises for Reader and State chaptersWilliam Carroll1-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) } ```