base-4.10.1.0: Basic libraries

Description

This library defines parser combinators for precedence parsing.

Synopsis

Instances

Precedences

type Prec = Int Source #

Precedence operations

Lift a precedence-insensitive ReadP to a ReadPrec.

(prec n p) checks whether the precedence context is less than or equal to n, and

• if not, fails
• if so, parses p in context n.

Increases the precedence context by one.

Resets the precedence context to zero.

Other operations

All are based directly on their similarly-named ReadP counterparts.

Consumes and returns the next character. Fails if there is no input left.

Look-ahead: returns the part of the input that is left, without consuming it.

Symmetric choice.

Local, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used.

Always fails.

Combines all parsers in the specified list.