Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Primitive parsers.
Regarding consuming input, unless states otherwise, all of these behave as follows:
- If a parser succeeds, it consumes the input it matches
- If a parser fails, it does not consume any input at all
- anyToken :: (Monad m, Stream s t, Token t) => ParcomT s t m t
- oneOf :: (Monad m, Stream s t, Token t, Show t, Eq t) => [t] -> ParcomT s t m t
- noneOf :: (Monad m, Stream s t, Token t, Show t, Eq t) => [t] -> ParcomT s t m t
- eof :: (Monad m, Stream s t, Token t) => ParcomT s t m ()
- satisfy :: (Monad m, Stream s t, Token t) => (t -> Bool) -> ParcomT s t m t
- token :: (Monad m, Stream s t, Token t, Show t, Eq t) => t -> ParcomT s t m t
- tokens :: (Monad m, Stream s t, Token t, Eq t, Show t) => [t] -> ParcomT s t m [t]
- prefix :: (Monad m, Stream s t, Token t, Eq t, Show t, Listish s t) => s -> ParcomT s t m s
Documentation
anyToken :: (Monad m, Stream s t, Token t) => ParcomT s t m t Source
Gets the next token from the stream
oneOf :: (Monad m, Stream s t, Token t, Show t, Eq t) => [t] -> ParcomT s t m t Source
Matches one token against a list of possible tokens; returns the matching token or fails.
noneOf :: (Monad m, Stream s t, Token t, Show t, Eq t) => [t] -> ParcomT s t m t Source
Matches one token against a list of prohibited tokens; returns the non-matching token or fails.
eof :: (Monad m, Stream s t, Token t) => ParcomT s t m () Source
Succeeds iff end-of-input has been reached
satisfy :: (Monad m, Stream s t, Token t) => (t -> Bool) -> ParcomT s t m t Source
Succeeds if the given predicate is met for the next token.
token :: (Monad m, Stream s t, Token t, Show t, Eq t) => t -> ParcomT s t m t Source
Exactly match one particular token
tokens :: (Monad m, Stream s t, Token t, Eq t, Show t) => [t] -> ParcomT s t m [t] Source
Match a series of tokens exactly