Fwd: transformers versus mtl

Isaac Dupree ml at isaac.cedarswampstudios.org
Tue Mar 24 19:39:04 EDT 2009


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.
>
> ...?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.

well, if base monad `m` is not a Functor, then it seems decidedly odd to me 
for the transformed monad to become a Functor... the transformer would be 
doing more than you'd expect!  But if you don't use (Functor (ReaderT r m)), 
only (Monad (ReaderT r m)), perhaps it works as well as could be expected?  
(Or maybe it doesn't work after all; then my logic here is useless)

-Isaac



More information about the Libraries mailing list