Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | ekmett@gmail.com |
- class (Alternative m, MonadPlus m) => MonadParser m where
- try :: m a -> m a
- labels :: m a -> Set String -> m a
- skipMany :: m a -> m ()
- satisfy :: (Char -> Bool) -> m Char
- satisfy8 :: (Word8 -> Bool) -> m Word8
- highlight :: Highlight -> m a -> m a
- liftIt :: It Rope a -> m a
- mark :: m Delta
- unexpected :: MonadParser m => String -> m a
- line :: m ByteString
- release :: Delta -> m ()
- satisfyAscii :: MonadParser m => (Char -> Bool) -> m Char
- restOfLine :: MonadParser m => m ByteString
- (<?>) :: MonadParser m => m a -> String -> m a
- skipping :: MonadParser m => Delta -> m ()
- slicedWith :: MonadParser m => (a -> ByteString -> r) -> m a -> m r
- sliced :: MonadParser m => m a -> m ByteString
- rend :: MonadParser m => m Rendering
Documentation
class (Alternative m, MonadPlus m) => MonadParser m whereSource
Take a parser that may consume input, and on failure, go back to where we started and fail as if we didn't consume input.
labels :: m a -> Set String -> m aSource
A version of many that discards its input. Specialized because it can often be implemented more cheaply.
satisfy :: (Char -> Bool) -> m CharSource
Parse a single character of the input, with UTF-8 decoding
satisfy8 :: (Word8 -> Bool) -> m Word8Source
Parse a single byte of the input, without UTF-8 decoding
highlight :: Highlight -> m a -> m aSource
highlight
is called internally in the token parsers.
It delimits ranges of the input recognized by certain parsers that
are useful for syntax highlighting. An interested monad could
choose to listen to these events and construct an interval tree
for later pretty printing purposes.
liftIt :: It Rope a -> m aSource
Lift an operation from the primitive It monad
mark the current location so it can be used in constructing a span, or for later seeking
unexpected :: MonadParser m => String -> m aSource
Used to emit an error on an unexpected token
line :: m ByteStringSource
Retrieve the contents of the current line (from the beginning of the line)
release :: Delta -> m ()Source
Seek back to previously marked location
MonadParser m => MonadParser (IdentityT m) | |
MonadParser m => MonadParser (Yoneda m) | |
MonadParser (Parser e) | |
MonadParser m => MonadParser (ReaderT e m) | |
MonadParser m => MonadParser (StateT s m) | |
MonadParser m => MonadParser (StateT s m) | |
(MonadParser m, Monoid w) => MonadParser (WriterT w m) | |
(MonadParser m, Monoid w) => MonadParser (WriterT w m) | |
(MonadParser m, Monoid w) => MonadParser (RWST r w s m) | |
(MonadParser m, Monoid w) => MonadParser (RWST r w s m) |
satisfyAscii :: MonadParser m => (Char -> Bool) -> m CharSource
restOfLine :: MonadParser m => m ByteStringSource
grab the remainder of the current line
(<?>) :: MonadParser m => m a -> String -> m aSource
label a parser with a name
skipping :: MonadParser m => Delta -> m ()Source
slicedWith :: MonadParser m => (a -> ByteString -> r) -> m a -> m rSource
run a parser, grabbing all of the text between its start and end points
sliced :: MonadParser m => m a -> m ByteStringSource
run a parser, grabbing all of the text between its start and end points and discarding the original result
rend :: MonadParser m => m RenderingSource