transformers: instance MonadTrans Compose

Ross Paterson ross at soi.city.ac.uk
Sun Dec 16 21:22:49 CET 2012


On Sun, Dec 16, 2012 at 06:30:45PM +0000, Henning Thielemann wrote:
> What about this instance:
> 
> module Data.Functor.Compose
> 
> import Control.Monad.Trans.Class (MonadTrans, lift)
> 
> instance (Monad f) => MonadTrans (Compose f) where
>      lift x = Compose (return x)
> 
> ?

MonadTrans suggests that the constructed thing is a monad
(though I see the documentation doesn't quite say that).



More information about the Libraries mailing list