Safe Haskell | None |
---|---|
Language | Haskell2010 |
Continuation-passing parser for context-free grammars
- newtype Parser (g :: (* -> *) -> *) s r = Parser {
- applyParser :: forall x. s -> (r -> s -> (FailureInfo -> x) -> x) -> (FailureInfo -> x) -> x
- data Result (g :: (* -> *) -> *) s v
- = Parsed {
- parsedPrefix :: !v
- parsedSuffix :: !s
- | NoParse FailureInfo
- = Parsed {
- alt :: forall g s a. Parser g s a -> Parser g s a -> Parser g s a
Documentation
newtype Parser (g :: (* -> *) -> *) s r Source #
Parser type for context-free grammars that uses a continuation-passing algorithm, fast for grammars in LL(1) class but with potentially exponential performance for longer ambiguous prefixes.
Parser | |
|
MultiParsing Parser Source # | Continuation-passing context-free parser
|
MonoidParsing (Parser g) Source # | |
Monad (Parser g s) Source # | |
Functor (Parser g s) Source # | |
Applicative (Parser g s) Source # | |
FactorialMonoid s => Alternative (Parser g s) Source # | |
FactorialMonoid s => MonadPlus (Parser g s) Source # | |
(Lexical g, LexicalConstraint Parser g s, Show s, TextualMonoid s) => TokenParsing (Parser g s) Source # | |
FactorialMonoid s => LookAheadParsing (Parser g s) Source # | |
(Show s, TextualMonoid s) => CharParsing (Parser g s) Source # | |
FactorialMonoid s => Parsing (Parser g s) Source # | |
Semigroup x => Semigroup (Parser g s x) Source # | |
Monoid x => Monoid (Parser g s x) Source # | |
type ResultFunctor Parser Source # | |
type GrammarConstraint Parser g Source # | |
data Result (g :: (* -> *) -> *) s v Source #
Parsed | |
| |
NoParse FailureInfo |