Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- split :: bc -> Parser bc t a -> t -> Split bc t a
- ignoreChildren :: Parser bc t b -> Split bc t b
- continue :: (Parser bc t a -> Parser bc t b) -> Split bc t a -> Split bc t b
- parseNode :: (Semigroup bc, IsTree t) => (t -> bc) -> bc -> Parser bc t a -> t -> Parser bc t a
- parseChildren :: (IsTree t, Semigroup bc) => (t -> bc) -> bc -> Parser bc t a -> [t] -> [a]
- getResult :: Parser bc t a -> Maybe a
- runParser :: (Monoid bc, IsTree t) => (t -> bc) -> t -> Parser bc t a -> Maybe a
- mapBreadcrumbs :: (bc' -> bc) -> Parser bc t a -> Parser bc' t a
Documentation
split :: bc -> Parser bc t a -> t -> Split bc t a Source #
Split a parser into a parser to run on the node's children, and how to reassemble those pieces into a parser for the current node.
Since: 0.1.0.0
ignoreChildren :: Parser bc t b -> Split bc t b Source #
There is no work to do for the children, so ignore them.
Since: 0.1.0.0
continue :: (Parser bc t a -> Parser bc t b) -> Split bc t a -> Split bc t b Source #
Append a continuation after a Split
.
Since: 0.1.0.0
parseNode :: (Semigroup bc, IsTree t) => (t -> bc) -> bc -> Parser bc t a -> t -> Parser bc t a Source #
Parse the current node by splitting the parser, accumulating the results of each child, and then running the continuation.
Since: 0.1.0.0
parseChildren :: (IsTree t, Semigroup bc) => (t -> bc) -> bc -> Parser bc t a -> [t] -> [a] Source #
Run a parser on each child, accumulating the results.
Since: 0.1.0.0
getResult :: Parser bc t a -> Maybe a Source #
Extract a value from a parser. The way the applicative evaluates, all "combinator" effects are guaranteed to have been run by the time this function gets called.
Since: 0.1.0.0