Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- peekToken :: (Stream s, Monad m) => ParserT e s m (Maybe (Token s))
- popToken :: (Stream s, Monad m) => ParserT e s m (Maybe (Token s))
- peekChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Maybe (Chunk s))
- popChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Maybe (Chunk s))
- dropChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Maybe Int)
- isEnd :: (Stream s, Monad m) => ParserT e s m Bool
- matchEnd :: (Stream s, Monad m) => ParserT e s m ()
- anyToken :: (Stream s, Monad m) => ParserT e s m (Token s)
- anyChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Chunk s)
- satisfyToken :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m (Token s)
- foldTokensWhile :: (Stream s, Monad m) => (Token s -> x -> (Bool, x)) -> (x -> x) -> x -> ParserT e s m x
- takeTokensWhile :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m (Chunk s)
- takeTokensWhile1 :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m (Chunk s)
- dropTokensWhile :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m Int
- dropTokensWhile1 :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m Int
- matchToken :: (Stream s, Monad m, Eq (Token s)) => Token s -> ParserT e s m (Token s)
- matchChunk :: (Stream s, Monad m, Eq (Chunk s)) => Chunk s -> ParserT e s m (Chunk s)
Documentation
peekToken :: (Stream s, Monad m) => ParserT e s m (Maybe (Token s)) Source #
Return the next token, if any, but don't consume it.
popToken :: (Stream s, Monad m) => ParserT e s m (Maybe (Token s)) Source #
Return the next token, if any, and consume it.
peekChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Maybe (Chunk s)) Source #
Return the next chunk of the given size, if any, but don't consume it. May return a smaller chunk at end of stream, but never returns an empty chunk.
popChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Maybe (Chunk s)) Source #
Return the next chunk of the given size, if any, and consume it. May return a smaller chunk at end of stream, but never returns an empty chunk.
dropChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Maybe Int) Source #
Drop the next chunk of the given size, if any, and consume it. May return a smaller size at end of stream, but never returns size 0.
matchEnd :: (Stream s, Monad m) => ParserT e s m () Source #
Match the end of the stream or terminate the parser.
anyToken :: (Stream s, Monad m) => ParserT e s m (Token s) Source #
Return the next token or terminate the parser at end of stream.
anyChunk :: (Stream s, Monad m) => Int -> ParserT e s m (Chunk s) Source #
Return the next chunk of the given size or terminate the parser at end of stream. May return a smaller chunk at end of stream, but never returns an empty chunk.
satisfyToken :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m (Token s) Source #
Match the next token with the given predicate or terminate the parser at predicate false or end of stream.
foldTokensWhile :: (Stream s, Monad m) => (Token s -> x -> (Bool, x)) -> (x -> x) -> x -> ParserT e s m x Source #
Folds over a stream of tokens while the boolean value is true. Always succeeds, even at end of stream.
takeTokensWhile :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m (Chunk s) Source #
Take tokens into a chunk while they satisfy the given predicate. Always succeeds, even at end of stream. May return an empty chunk.
takeTokensWhile1 :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m (Chunk s) Source #
Take tokens into a chunk while they satisfy the given predicate. Only succeeds if 1 or more tokens are taken, so it never returns an empty chunk.
dropTokensWhile :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m Int Source #
Drop tokens and return chunk size while they satisfy the given predicate. Always succeeds, even at end of stream. May return empty chunk size 0.
dropTokensWhile1 :: (Stream s, Monad m) => (Token s -> Bool) -> ParserT e s m Int Source #
Drop tokens and return chunk size while they satisfy the given predicate. Only succeeds if 1 or more tokens are dropped.