mtl: Context of execWriterT

Ross Paterson ross at
Thu Apr 14 15:20:19 CEST 2011

On Thu, Apr 14, 2011 at 03:02:18PM +0200, Daniel Fischer wrote:
> Alas, Functor is not a superclass of Monad, so a Monad constraint is not 
> more restrictive than a Functor constraint.

Yes, that is the issue -- as those classes are now, making this change
would break programs.

Several functions are affected by the same issue:

  ReaderT: ask asks
  StateT: evalStateT execStateT get put gets liftListen liftPass
  WriterT: execWriterT tell listen listens pass censor

It's particularly annoying for ReaderT and WriterT, now that they're
Applicative transformers as well as Monad transformers.

More information about the Libraries mailing list