Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data TrailingParsec err strm a
- toHeadedParsec :: (Ord err, Stream strm) => TrailingParsec err strm a -> HeadedParsec err strm a
- toParsec :: (Ord err, Stream strm) => TrailingParsec err strm a -> Parsec err strm a
- label :: (Ord err, Stream strm) => String -> TrailingParsec err strm a -> TrailingParsec err strm a
- dbg :: (Ord err, ShowErrorComponent err, Stream strm, Show a) => String -> TrailingParsec err strm a -> TrailingParsec err strm a
- filter :: (Ord err, Stream strm) => (a -> String) -> (a -> Bool) -> TrailingParsec err strm a -> TrailingParsec err strm a
- parse :: (Ord err, Stream strm) => Parsec err strm a -> TrailingParsec err strm a
- parseHeaded :: (Ord err, Stream strm) => HeadedParsec err strm a -> TrailingParsec err strm a
- endHead :: Stream strm => TrailingParsec err strm ()
Documentation
data TrailingParsec err strm a Source #
Accumulates the sequently composed alternatives, alternating between all combinations when executed.
Instances
Execution
toHeadedParsec :: (Ord err, Stream strm) => TrailingParsec err strm a -> HeadedParsec err strm a Source #
Transformation
label :: (Ord err, Stream strm) => String -> TrailingParsec err strm a -> TrailingParsec err strm a Source #
Label a headed parser.
Works the same way as megaparsec's label
.
dbg :: (Ord err, ShowErrorComponent err, Stream strm, Show a) => String -> TrailingParsec err strm a -> TrailingParsec err strm a Source #
Make a parser print debugging information when evaluated. The first parameter is a custom label.
This function is a wrapper around dbg
.
It generates two debugging entries: one for head and one for tail.
filter :: (Ord err, Stream strm) => (a -> String) -> (a -> Bool) -> TrailingParsec err strm a -> TrailingParsec err strm a Source #
Filter the results of parser based on a predicate, failing with a parameterized message.
Construction
parse :: (Ord err, Stream strm) => Parsec err strm a -> TrailingParsec err strm a Source #
Lift a megaparsec parser.
parseHeaded :: (Ord err, Stream strm) => HeadedParsec err strm a -> TrailingParsec err strm a Source #
Lift a headed parser.
endHead :: Stream strm => TrailingParsec err strm () Source #
Make all the following parsers compose as tail.