A continuation passing style parser representation. A continuation of
Steps, each step passes a state and a parse result to the next Step. The
resulting Step may carry a continuation that consumes input a and
results in another Step. Essentially, the continuation may either consume
input without a result or return a result with no further input to be
consumed.
Instances7Monad, Functor, MonadFail, Applicative, Alternative, MonadPlus, …
Monad m => Monad (ParserK a m)Defined in streamly-core-0.2.2 · Streamly.Internal.Data.ParserK.TypeMonad composition can be used for lookbehind parsers, we can dynamically compose new parsers based on the results of the previously parsed values.
Functor m => Functor (ParserK a m)Defined in streamly-core-0.2.2 · Streamly.Internal.Data.ParserK.TypeMap a function on the result i.e. on
binParser a m b.Monad m => MonadFail (ParserK a m)Defined in streamly-core-0.2.2 · Streamly.Internal.Data.ParserK.TypeMonad m => Applicative (ParserK a m)Defined in streamly-core-0.2.2 · Streamly.Internal.Data.ParserK.Typef <$> p1 <*> p2applies parsers p1 and p2 sequentially to an input stream. The first parser runs and processes the input, the remaining input is then passed to the second parser. If both parsers succeed, their outputs are applied to the functionf. If either parser fails, the operation fails.Monad m => Alternative (ParserK a m)Defined in streamly-core-0.2.2 · Streamly.Internal.Data.ParserK.Typep1 <|> p2passes the input to parser p1, if it succeeds, the result is returned. However, if p1 fails, the parser driver backtracks and tries the same input on the alternative parser p2, returning the result if it succeeds.Monad m => MonadPlus (ParserK a m)Defined in streamly-core-0.2.2 · Streamly.Internal.Data.ParserK.TypeMonadIO m => MonadIO (ParserK a m)Defined in streamly-core-0.2.2 · Streamly.Internal.Data.ParserK.Type