Fwd: transformers versus mtl

Ross Paterson ross at soi.city.ac.uk
Tue Mar 24 19:30:55 EDT 2009


On Tue, Mar 24, 2009 at 04:14:38PM -0700, Iavor Diatchki wrote:
> On Tue, Mar 24, 2009 at 2:42 PM, Sittampalam, Ganesh
> <ganesh.sittampalam at credit-suisse.com> wrote:
> > Sittampalam, Ganesh wrote:
> > ...the Functor instances for
> > ReaderT r m and WriterT w m now (correctly) depend on Functor m,
> > whereas in mtl they depend on Monad m.
> 
> Does anyone ever use ReaderT and WriterT with a type that is not a
> monad (i.e., use them as functor transformers rather then monad
> transformers)?  On the other hand, with the unfortunate lack of
> relation between Functor and Monad in Haskell, it seems these
> instances will not work if I try to transform a monad that does not
> have a functor instance.

It's more that they're used polymorphically, and the constraint Monad m
is now insufficient: Functor m is also needed.


More information about the Libraries mailing list