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
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.
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.
Instances For
Try p, then decide what to do based on success or failure without consuming input on failure.
Instances For
Try p, and if it fails without consuming input, run q () instead.
Instances For
Attempt to parse with p, but don't consume input on failure.
Instances For
Succeeds only if input is at end-of-file.
Instances For
Instances For
Instances For
Instances For
Gets the next input element.
Instances For
Checks if the next input element matches some condition.
Instances For
Peeks at the next element, returns some if exists else none, does not consume input.
Instances For
Peeks at the next element, returns some elem if it satisfies p, else none. Does not consume input.
Instances For
Peeks at the next element, errors on EOF, does not consume input.
Instances For
Peeks at the next element or returns a default if at EOF, does not consume input.
Instances For
Consumes one element if available, otherwise errors on EOF.
Instances For
Parses zero or more chars with p, accumulates into a string.
Parses zero or more chars with p into a string.
Instances For
Parses one or more chars with p into a string, errors if none.