Copyright | Mario Blažević <blamario@yahoo.com> 2015 |
---|---|
License | BSD3 |
Maintainer | Mario Blažević |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides the basic support for parsing state.
To support state, the parser input must be a Stateful
monoid. The parsing state thus becomes the final part of the
input, accessible and modifiable during the parse. Be careful to account for the presence of state before the
endOfInput
! The following parser, for example, would loop forever:
many (setState "more" *> anyToken)