input-parsers-0.1: Extension of the parsers library with more capability and efficiency

Text.Parser.Deterministic

Description

Deterministic parsers can be restricted to a single parsing result.

Synopsis

Documentation

class Parsing m => DeterministicParsing m where Source #

Combinator methods for constructing deterministic parsers, i.e., parsers that can succeed with only a single result.

Minimal complete definition

Nothing

Methods

(<<|>) :: m a -> m a -> m a infixl 3 Source #

Left-biased choice: if the left alternative succeeds, the right one is never tried.

takeOptional :: m a -> m (Maybe a) Source #

Like optional, but never succeeds with Nothing if the argument parser can succeed.

takeMany :: m a -> m [a] Source #

Like some, but always consuming the longest matching sequence of input.

takeSome :: m a -> m [a] Source #

Like some, but always consuming the longest matching sequence of input.

concatAll :: Monoid a => m a -> m a Source #

Like concatMany, but always consuming the longest matching sequence of input.

skipAll :: m a -> m () Source #

Like skipMany, but always consuming the longest matching sequence of input.

Instances