View Source Chrysopoeia.Sequence (chrysopoeia v0.1.2)
Combinators for applying parsers in sequence.
Link to this section Summary
Functions
A combinator. Takes a list of parsers, uses each parser in the list sequentially, and returns a list of their outputs.
A combinator. First applies the prefix
parser, then applies parser
, and
returns the result of parser
.
A combinator. First applies parser
, then the suffix
parser, and returns
the result of parser
.
Link to this section Functions
A combinator. Takes a list of parsers, uses each parser in the list sequentially, and returns a list of their outputs.
By wrapping a parser in {:ig, parser}
, its output will not be included in
the final output.
@spec prefix(Chrysopoeia.parser(i, any(), e1), Chrysopoeia.parser(i, o, e2)) :: Chrysopoeia.parser(i, o, e1 | e2)
A combinator. First applies the prefix
parser, then applies parser
, and
returns the result of parser
.
@spec suffix(Chrysopoeia.parser(i, o, e1), Chrysopoeia.parser(i, any(), e2)) :: Chrysopoeia.parser(i, o, e1 | e2)
A combinator. First applies parser
, then the suffix
parser, and returns
the result of parser
.