ParseError package:megaparsec

ParseError s e represents a parse error parametrized over the stream type s and the custom data e. Semigroup and Monoid instances of the data type allow us to merge parse errors from different branches of parsing. When merging two ParseErrors, the longest match is preferred; if positions are the same, custom data sets and collections of message items are combined. Note that fancy errors take precedence over trivial errors in merging.
Stop parsing and report the ParseError. This is the only way to control position of the error without manipulating the parser state manually.
A non-empty collection of ParseErrors equipped with PosState that allows us to pretty-print the errors efficiently and correctly.
Pretty-print a ParseError. The rendered String always ends with a newline.
Pretty-print a textual part of a ParseError, that is, everything except for its position. The rendered String always ends with a newline.
Register a ParseError for later reporting. This action does not end parsing and has no effect except for adding the given ParseError to the collection of “delayed” ParseErrors which will be taken into consideration at the end of parsing. Only if this collection is empty the parser will succeed. This is the main way to report several parse errors at once.
Collection of “delayed” ParseErrors in reverse order. This means that the last registered error is the first element of the list.
Modify the custom data component in a parse error. This could be done via fmap if not for the Ord constraint.