The Commitment class is an abstraction over all the current
concrete representations of monadic/applicative parser combinators in this
package. The common feature is two-level error-handling.
Some primitives must be implemented specific to each parser type
(e.g. depending on whether the parser has a running state, or
whether it is lazy). But given those primitives, large numbers of
combinators do not depend any further on the internal structure of
the particular parser.
Methods
commit :: p a -> p aCommit is a way of raising the severity of any errors found within its argument. Used in the middle of a parser definition, it means that any operations prior to commitment fail softly, but after commitment, they fail hard.
adjustErr :: p a -> (String -> String) -> p ap adjustErr fapplies the transformationfto any error message generated inp, having no effect ifpsucceeds.oneOf' :: [(String, p a)] -> p aParse the first alternative that succeeds, but if none succeed, report only the severe errors, and if none of those, then report all the soft errors.
Instances9Commitment, …
Commitment ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.ByteStringCommitment ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.ByteStringCharCommitment ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.TextCommitment (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.LazyCommitment (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.LexCommitment (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.ParserCommitment (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateTextCommitment (Parser s t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateLazyCommitment (Parser s t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateParser