ParserT monad transformer and Parser type
ParsecT s u m a is a parser with stream type s, user state type u,
underlying monad m and return type a. Parsec is strict in the user state.
If this is undesirable, simply use a data type like data Box a = Box a and
the state type Box YourStateType to add a level of indirection.
Instances14MonadError, MonadReader, MonadState, MonadTrans, Monad, Functor, …
MonadError e m => MonadError e (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadReader r m => MonadReader r (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadState s m => MonadState s (ParsecT s' u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadTrans (ParsecT s u)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonad (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimFunctor (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadFail (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimApplicative (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimAlternative (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadPlus (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadIO m => MonadIO (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadCont m => MonadCont (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimSemigroup a => Semigroup (ParsecT s u m a)Defined in parsec-3.1.18.0 · Text.Parsec.PrimThe Semigroup instance for ParsecT is used to append the result of several parsers, for example:
(many $ chara) <> (many $ charb)The above will parse a string like
"aabbb"and return a successful parse result"aabbb". Compare against the below which will produce a result of"bbb"for the same input:(many $ chara) >> (many $ charb) (many $ chara) *> (many $ charb)(Monoid a, Semigroup (ParsecT s u m a)) => Monoid (ParsecT s u m a)Defined in parsec-3.1.18.0 · Text.Parsec.Prim