parser package:parsec-class

parserTrace label is an impure function, implemented with Debug.Trace that prints to the console the remaining parser state at the time it is invoked. It is intended to be used for debugging parsers by inspecting their intermediate states.
*> parseTest (oneOf "aeiou"  >> parserTrace "label") "atest"
label: "test"
...
parserTraced label p is an impure function, implemented with Debug.Trace that prints to the console the remaining parser state at the time it is invoked. It then continues to apply parser p, and if p fails will indicate that the label has been backtracked. It is intended to be used for debugging parsers by inspecting their intermediate states.
*>  parseTest (oneOf "aeiou"  >> parserTraced "label" (oneOf "nope")) "atest"
label: "test"
label backtracked
parse error at (line 1, column 2):
...
parserZero always fails without consuming any input. parserZero is defined equal to the mzero member of the MonadPlus class and to the empty member of the Alternative class.
A simplified ParsecT parser that consumes some kind of character stream without requiring any particular state state.
Types that are instances of this class can be parsed and constructed from some character based text representation.
Returns the full parser state as a State record.
The most general way to run a parser over the Identity monad. runParser p state filePath input runs parser p on the input list of tokens input, obtained from source filePath with the initial user state st. The filePath is only used in error messages and may be the empty string. Returns either a ParseError (Left) or a value of type a (Right).
parseFromFile p fname
= do{ input <- readFile fname
; return (runParser p () fname input)
}
The most general way to run a parser. runParserT p state filePath input runs parser p on the input list of tokens input, obtained from source filePath with the initial user state st. The filePath is only used in error messages and may be the empty string. Returns a computation in the underlying monad m that return either a ParseError (Left) or a value of type a (Right).
setParserState st set the full parser state to st.
updateParserState f applies function f to the parser state.