incremental-parser-0.3.1.1: Generic parser library capable of providing partial results from partial input.

Text.ParserCombinators.Incremental.Symmetric

Description

This module defines parsing combinators for incremental parsers with symmetric choice.

The exported Parser type can provide partial parsing results from partial input, as long as the output is a Monoid. Construct a parser using the primitives and combinators, supply it with input using functions feed and feedEof, and extract the parsed output using results.

Implementation is based on Brzozowski derivatives.

Synopsis

# Documentation

type Parser s r = Parser Symmetric s r Source #

data Symmetric Source #

An empty type to specialize Parser for the symmetric Alternative instance.

Instances

 Source # The symmetric version of the <|> choice combinator. Methods(<|>) :: Parser Symmetric s a -> Parser Symmetric s a -> Parser Symmetric s a #some :: Parser Symmetric s a -> Parser Symmetric s [a] #many :: Parser Symmetric s a -> Parser Symmetric s [a] # Source # The MonadPlus instances are the same as the Alternative instances. Methodsmplus :: Parser Symmetric s a -> Parser Symmetric s a -> Parser Symmetric s a #

allOf :: Parser s r -> Parser a s r Source #