[Haskell-beginners] Mixing monads?

Felipe Lessa felipe.lessa at gmail.com
Sun Mar 28 14:43:48 EDT 2010


On Sun, Mar 28, 2010 at 06:03:04PM +0100, Stephen Tetley wrote:
> It looks like Attoparsec doesn't supply a transformer instance so that
> obliges you to make CBC a transformer instead

I should note that in general monad transoformers do not commute.
That is,

  ParserT CBC a

and

  CbcT Parser a

may not mean the same thing.  For example, suppose you get a
parse failure and you need to backtrack.  Do you want to maintain
the same CBC state, or do you want to backtrack the CBC state as
well?  I'd guess the latter, so probably having a CbcT won't help
you, I think.

--
Felipe.


More information about the Beginners mailing list