Result of a parsing operation.
This is essentially a very specialised version of Either
(and can, in fact, be turned into one through
toEither).
A result keeps track of whether or not any data has been consumed when producing it. This is used to decide whether or not to try alternative parsers in a Parser.| call.
Results also store an error message even if they're successful. This might seem a little odd, but is necessary to be able to provide good error messages for combinators such as Parser.filter where we might turn a success into a failure after the fact.
- Companion:
- object