Example: Parsing
- A parser can fail -- we handle failure by trying an alternative.
- A parser consumes input -- has a state, the input to parse.
- A failing parse should not change the state.
type Parser m tok a = State [tok] (Failure m) a
- return x -- accept no tokens & succeed
- do syntax -- for sequencing
- failure -- the failing parser