Annotations-0.2.1: Constructing, analyzing and destructing annotated trees

Safe HaskellSafe-Inferred
LanguageHaskell98

Annotations.F.ParserCombinators

Contents

Synopsis

Parser combinators for bounds parsers

mkBounded :: Monad m => Range -> AnnFix1 Bounds f -> P s m (AnnFix Bounds f) Source

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 :: Monad m => P s m (AnnFix1 Bounds f) -> P s m (AnnFix Bounds f) Source

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

chainr :: Monad m => P s m (AnnFix Bounds f) -> P s m (AnnFix Bounds f -> AnnFix Bounds f -> AnnFix1 Bounds f) -> P s m (AnnFix Bounds f) Source

Parse right-recursive structures.

chainl :: Monad m => P s m (AnnFix Bounds f) -> P s m (AnnFix Bounds f -> AnnFix Bounds f -> AnnFix1 Bounds f) -> P s m (AnnFix Bounds f) Source

Parse left-recursive structures.