Annotations-0.2: Constructing, analyzing and destructing annotated trees

Safe HaskellSafe-Infered

Annotations.MultiRec.ParserCombinators

Synopsis

Documentation

type YP s fam m = P s (YieldT Bounds fam m)Source

A parser that yields its components, annotated with Bounds.

mkBounded :: (Fam fam, EqS fam, HFunctor fam (PF fam), Monad m) => fam a -> Range -> a -> YP s fam m aSource

Given the left margin of a structure, asks the parser for the right margin and wraps the position information around the root of the tree.

unit :: (Fam fam, EqS fam, HFunctor fam (PF fam), Monad m) => fam a -> YP s fam m a -> YP s fam m aSource

Wrap an unnotated tree with position information from the parse state.

chainr :: (Fam fam, EqS fam, HFunctor fam (PF fam), Monad m, Show a) => fam a -> YP s fam m a -> YP s fam m (a -> a -> a) -> YP s fam m aSource

Parse right-recursive structures.

chainl :: (Fam fam, EqS fam, HFunctor fam (PF fam), Monad m, Show a) => fam a -> YP s fam m a -> YP s fam m (a -> a -> a) -> YP s fam m aSource

Parse left-recursive structures.