grammatical-parsers-0.3.2: parsers that combine into grammars

Safe HaskellNone
LanguageHaskell2010

Text.Grampa.ContextFree.SortedMemoizing

Synopsis

Documentation

data ResultList g s r Source #

Constructors

ResultList ![ResultsOfLength g s r] !FailureInfo 
Instances
Functor (ResultList g s) Source # 
Instance details

Defined in Text.Grampa.Internal

Methods

fmap :: (a -> b) -> ResultList g s a -> ResultList g s b #

(<$) :: a -> ResultList g s b -> ResultList g s a #

Show1 (ResultList g s) Source # 
Instance details

Defined in Text.Grampa.Internal

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ResultList g s a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ResultList g s a] -> ShowS #

Show r => Show (ResultList g s r) Source # 
Instance details

Defined in Text.Grampa.Internal

Methods

showsPrec :: Int -> ResultList g s r -> ShowS #

show :: ResultList g s r -> String #

showList :: [ResultList g s r] -> ShowS #

Semigroup (ResultList g s r) Source # 
Instance details

Defined in Text.Grampa.Internal

Methods

(<>) :: ResultList g s r -> ResultList g s r -> ResultList g s r #

sconcat :: NonEmpty (ResultList g s r) -> ResultList g s r #

stimes :: Integral b => b -> ResultList g s r -> ResultList g s r #

Monoid (ResultList g s r) Source # 
Instance details

Defined in Text.Grampa.Internal

Methods

mempty :: ResultList g s r #

mappend :: ResultList g s r -> ResultList g s r -> ResultList g s r #

mconcat :: [ResultList g s r] -> ResultList g s r #

newtype Parser g s r Source #

Parser for a context-free grammar with packrat-like sharing of parse results. It does not support left-recursive grammars.

Constructors

Parser 

Fields

Instances
GrammarParsing Parser Source # 
Instance details

Defined in Text.Grampa.ContextFree.SortedMemoizing

Associated Types

type GrammarFunctor Parser :: ((Type -> Type) -> Type) -> Type -> Type -> Type Source #

MultiParsing Parser Source #

Memoizing parser guarantees O(n²) performance for grammars with unambiguous productions, but provides no left recursion support.

parseComplete :: (Rank2.Functor g, FactorialMonoid s) =>
                 g (Memoizing.Parser g s) -> s -> g (Compose ParseResults [])
Instance details

Defined in Text.Grampa.ContextFree.SortedMemoizing

MonoidParsing (Parser g) Source # 
Instance details

Defined in Text.Grampa.ContextFree.SortedMemoizing

Methods

endOfInput :: FactorialMonoid s => Parser g s () Source #

getInput :: FactorialMonoid s => Parser g s s Source #

anyToken :: FactorialMonoid s => Parser g s s Source #

satisfy :: FactorialMonoid s => (s -> Bool) -> Parser g s s Source #

satisfyChar :: TextualMonoid s => (Char -> Bool) -> Parser g s Char Source #

satisfyCharInput :: TextualMonoid s => (Char -> Bool) -> Parser g s s Source #

notSatisfy :: FactorialMonoid s => (s -> Bool) -> Parser g s () Source #

notSatisfyChar :: TextualMonoid s => (Char -> Bool) -> Parser g s () Source #

scan :: FactorialMonoid t => s -> (s -> t -> Maybe s) -> Parser g t t Source #

scanChars :: TextualMonoid t => s -> (s -> Char -> Maybe s) -> Parser g t t Source #

string :: (FactorialMonoid s, LeftReductiveMonoid s, Show s) => s -> Parser g s s Source #

takeWhile :: FactorialMonoid s => (s -> Bool) -> Parser g s s Source #

takeWhile1 :: FactorialMonoid s => (s -> Bool) -> Parser g s s Source #

takeCharsWhile :: TextualMonoid s => (Char -> Bool) -> Parser g s s Source #

takeCharsWhile1 :: TextualMonoid s => (Char -> Bool) -> Parser g s s Source #

concatMany :: Monoid a => Parser g s a -> Parser g s a Source #

GrammarParsing (Fixed Parser) Source # 
Instance details

Defined in Text.Grampa.ContextFree.LeftRecursive

Associated Types

type GrammarFunctor (Fixed Parser) :: ((Type -> Type) -> Type) -> Type -> Type -> Type Source #

MultiParsing (Fixed Parser) Source #

Parser of general context-free grammars, including left recursion.

parseComplete :: (Rank2.Apply g, Rank2.Traversable g, FactorialMonoid s) =>
                 g (LeftRecursive.'Fixed g s) -> s -> g (Compose ParseResults [])
Instance details

Defined in Text.Grampa.ContextFree.LeftRecursive

Monad (Parser g i) Source # 
Instance details

Defined in Text.Grampa.ContextFree.SortedMemoizing

Methods

(>>=) :: Parser g i a -> (a -> Parser g i b) -> Parser g i b #

(>>) :: Parser g i a -> Parser g i b -> Parser g i b #

return :: a -> Parser g i a #

fail :: String -> Parser g i a #

Functor (Parser g i) Source # 
Instance details

Defined in Text.Grampa.ContextFree.SortedMemoizing

Methods

fmap :: (a -> b) -> Parser g i a -> Parser g i b #

(<$) :: a -> Parser</