Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FailureInfo s = FailureInfo Int [Expected s]
- data ResultListT m g s r = ResultList {
- resultSuccesses :: ![ResultsOfLengthT m g s r]
- resultFailures :: !(FailureInfo s)
- newtype ParserT m g s r = Parser {
- applyParser :: [(s, g (ResultListT m g s))] -> ResultListT m g s r
- (<<|>) :: DeterministicParsing m => m a -> m a -> m a
- lift :: m a -> ParserT m g s a
- tmap :: (m a -> m b) -> ParserT m g s a -> ParserT m g s b
- longest :: ParserT Identity g s a -> Parser g [(s, g (ResultListT Identity g s))] a
- peg :: Applicative m => Parser g [(s, g (ResultListT m g s))] a -> ParserT m g s a
- terminalPEG :: (Applicative m, Monoid s) => Parser g s a -> ParserT m g s a
Documentation
data FailureInfo s Source #
FailureInfo Int [Expected s] |
Instances
Eq s => Eq (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal (==) :: FailureInfo s -> FailureInfo s -> Bool # (/=) :: FailureInfo s -> FailureInfo s -> Bool # | |
Show s => Show (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal showsPrec :: Int -> FailureInfo s -> ShowS # show :: FailureInfo s -> String # showList :: [FailureInfo s] -> ShowS # | |
Semigroup (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal (<>) :: FailureInfo s -> FailureInfo s -> FailureInfo s # sconcat :: NonEmpty (FailureInfo s) -> FailureInfo s # stimes :: Integral b => b -> FailureInfo s -> FailureInfo s # | |
Monoid (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal mempty :: FailureInfo s # mappend :: FailureInfo s -> FailureInfo s -> FailureInfo s # mconcat :: [FailureInfo s] -> FailureInfo s # |
data ResultListT m g s r Source #
ResultList | |
|
Instances
newtype ParserT m g s r Source #
Parser for a context-free grammar with packrat-like sharing that carries a monadic computation as part of the parse result.
Parser | |
|
Instances
(<<|>) :: DeterministicParsing m => m a -> m a -> m a infixl 3 #
Left-biased choice: if the left alternative succeeds, the right one is never tried.
tmap :: (m a -> m b) -> ParserT m g s a -> ParserT m g s b Source #
Modify the computation carried by the parser.
longest :: ParserT Identity g s a -> Parser g [(s, g (ResultListT Identity g s))] a Source #
Turns a context-free parser into a backtracking PEG parser that consumes the longest possible prefix of the list
of input tails, opposite of peg
peg :: Applicative m => Parser g [(s, g (ResultListT m g s))] a -> ParserT m g s a Source #
Turns a backtracking PEG parser of the list of input tails into a context-free parser, opposite of longest
terminalPEG :: (Applicative m, Monoid s) => Parser g s a -> ParserT m g s a Source #
Turns a backtracking PEG parser into a context-free parser