uu-parsinglib- Fast, online, error-correcting, monadic, applicative, merging, permuting, idiomatic parser combinators.






The data type Gram

data Gram f a Source



Gram [Alt f a] (Maybe a) 


Monad (Gram f) 
Functor f => Functor (Gram f)


Functor f => Applicative (Gram f)


Functor f => Alternative (Gram f) 
Functor f => ExtAlternative (Gram f) 
Functor f => IsParser (Gram f) 
Show a => Show (Gram f a) 

data Alt f a Source


forall b . Seq (f b) (Gram f (b -> a)) 


Functor f => Functor (Alt f) 

mkGram :: P t a -> Gram (P t) aSource


Class instances for Gram

Gram is a Monad




The function <<||> is a special version of <||>, whch only starts a new instance of its right operand when the left operand cannot proceed. This is used in the function pmMany, where we want to merge as many instances of its argument, but not more than that.

mkParserM :: (Monad f, Applicative f, ExtAlternative f) => Gram f a -> f aSource

mkParserM converts a Grammar back into a parser, which can subsequenly be run.

mkParserS :: (Monad f, Applicative f, ExtAlternative f) => f b -> Gram f a -> f aSource

mkParserS is like mkParserM, with the additional feature that we allow separators between the components. Only useful in the permuting case.


Run a sufficient number of p's in a merged fashion, but not more than necessary!!