Copyright | (c) Edward Kmett 2011-2019 |
---|---|
License | BSD3 |
Maintainer | ekmett@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- class (MonadPlus m, TokenParsing m) => DeltaParsing m where
- line :: m ByteString
- position :: m Delta
- slicedWith :: (a -> ByteString -> r) -> m a -> m r
- rend :: m Rendering
- restOfLine :: m ByteString
- sliced :: DeltaParsing m => m a -> m ByteString
- careting :: DeltaParsing m => m Caret
- careted :: DeltaParsing m => m a -> m (Careted a)
- spanning :: DeltaParsing m => m a -> m Span
- spanned :: DeltaParsing m => m a -> m (Spanned a)
- fixiting :: DeltaParsing m => m ByteString -> m Fixit
- class (DeltaParsing m, HasDelta d) => MarkParsing d m | m -> d where
Documentation
class (MonadPlus m, TokenParsing m) => DeltaParsing m where Source #
This class provides parsers with easy access to:
1) the current line contents.
2) the current position as a Delta
.
3) the ability to use sliced
on any parser.
line :: m ByteString Source #
Retrieve the contents of the current line (from the beginning of the line)
Retrieve the current position as a Delta
.
slicedWith :: (a -> ByteString -> r) -> m a -> m r Source #
Run a parser, grabbing all of the text between its start and end points
restOfLine :: m ByteString Source #
Grab the remainder of the current line
Instances
DeltaParsing Parser Source # | |
Defined in Text.Trifecta.Parser | |
(MonadPlus m, DeltaParsing m) => DeltaParsing (IdentityT m) Source # | |
Defined in Text.Trifecta.Combinators | |
(MonadPlus m, DeltaParsing m) => DeltaParsing (ReaderT e m) Source # | |
Defined in Text.Trifecta.Combinators | |
(MonadPlus m, DeltaParsing m) => DeltaParsing (StateT s m) Source # | |
Defined in Text.Trifecta.Combinators | |
(MonadPlus m, DeltaParsing m) => DeltaParsing (StateT s m) Source # | |
Defined in Text.Trifecta.Combinators | |
(MonadPlus m, DeltaParsing m, Monoid w) => DeltaParsing (WriterT w m) Source # | |
Defined in Text.Trifecta.Combinators | |
(MonadPlus m, DeltaParsing m, Monoid w) => DeltaParsing (WriterT w m) Source # | |
Defined in Text.Trifecta.Combinators | |
(MonadPlus m, DeltaParsing m, Monoid w) => DeltaParsing (RWST r w s m) Source # | |
Defined in Text.Trifecta.Combinators | |
(MonadPlus m, DeltaParsing m, Monoid w) => DeltaParsing (RWST r w s m) Source # | |
Defined in Text.Trifecta.Combinators |
sliced :: DeltaParsing m => m a -> m ByteString Source #
Run a parser, grabbing all of the text between its start and end points and discarding the original result
careted :: DeltaParsing m => m a -> m (Careted a) Source #
spanning :: DeltaParsing m => m a -> m Span Source #
Discard the result of a parse, returning a Span
from where we start to
where it ended parsing.
spanned :: DeltaParsing m => m a -> m (Spanned a) Source #
fixiting :: DeltaParsing m => m ByteString -> m Fixit Source #
Grab a fixit.
class (DeltaParsing m, HasDelta d) => MarkParsing d m | m -> d where Source #
This class is a refinement of DeltaParsing
that adds the ability to mark
your position in the input and return there for further parsing later.
mark the current location so it can be used in constructing a span, or for later seeking
Seek a previously marked location
Instances
MarkParsing Delta Parser Source # | |
(MonadPlus m, MarkParsing d m) => MarkParsing d (IdentityT m) Source # | |
(MonadPlus m, MarkParsing d m) => MarkParsing d (ReaderT e m) Source # | |
(MonadPlus m, MarkParsing d m) => MarkParsing d (StateT s m) Source # | |
(MonadPlus m, MarkParsing d m) => MarkParsing d (StateT s m) Source # | |
(MonadPlus m, MarkParsing d m, Monoid w) => MarkParsing d (WriterT w m) Source # | |
(MonadPlus m, MarkParsing d m, Monoid w) => MarkParsing d (WriterT w m) Source # | |
(MonadPlus m, MarkParsing d m, Monoid w) => MarkParsing d (RWST r w s m) Source # | |
(MonadPlus m, MarkParsing d m, Monoid w) => MarkParsing d (RWST r w s m) Source # | |