MonadPlus instance for ContT

John Wiegley johnw at
Mon Jun 24 21:20:42 CEST 2013

>>>>> Edward Kmett <ekmett at> writes:

> The third construction is the 'universal' lifting that works for every
> Applicative, which would look like:

> instance (Monad m, Monoid a) => Monoid (ContT r m a) where
>   mempty = return mempty
>   mappend = liftM2 mappend

Why not then this?  That is, once AMP is out...

    instance (Applicative m, Monoid a) => Monoid (m a) where
        mempty  = pure mempty
        mappend = liftA2 mappend

John Wiegley
FP Complete                         Haskell tools, training and consulting               johnw on #haskell/

More information about the Libraries mailing list