The result of parsing some string.
- success
{α ι : Type}
(pos : ι)
(res : α)
: ParseResult α ι
Parsing succeeded, returning the new position
posand the parsed resultres. - error
{α ι : Type}
(pos : ι)
(err : Error)
: ParseResult α ι
Parsing failed, returning the position
poswhere the error occurred and the errorerr.
Instances For
Equations
Equations
Instances For
A Parsec ι α represents a parser that consumes input of type ι and, produces a
ParseResult containing a value of type α (the result of parsing) and the remaining input.
Equations
Instances For
Interface for an input iterator with position tracking and lookahead support.
- pos : ι → idx
- next : ι → ι
- curr : ι → elem
- hasNext : ι → Bool
Instances
Parser that always fails with the given error message.
Equations
Instances For
Try p, then decide what to do based on success or failure without consuming input on failure.
Equations
Instances For
Try p, and if it fails without consuming input, run q () instead.
Equations
Instances For
Attempt to parse with p, but don't consume input on failure.
Equations
Instances For
Equations
Succeeds only if input is at end-of-file.
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Gets the next input element.
Equations
Instances For
Checks if the next input element matches some condition.
Equations
Instances For
Peeks at the next element, returns some if exists else none, does not consume input.
Equations
Instances For
Peeks at the next element, returns some elem if it satisfies p, else none. Does not consume input.
Equations
Instances For
Peeks at the next element, errors on EOF, does not consume input.
Equations
Instances For
Peeks at the next element or returns a default if at EOF, does not consume input.
Equations
Instances For
Consumes one element if available, otherwise errors on EOF.
Equations
Instances For
Parses zero or more chars with p, accumulates into a string.
Parses zero or more chars with p into a string.
Equations
Instances For
Parses one or more chars with p into a string, errors if none.