[Haskell-cafe] Where is the pairing-with-monoid monad instance?

Sean Leather leather at cs.uu.nl
Wed Jan 11 09:11:31 CET 2012


On Wed, Jan 11, 2012 at 03:23, Conal Elliott wrote:

> Is the standard pair-with-monoid monad instance in some standard place? I
> see the Applicative instance in Control.Applicative, and the
> pair-with-monoid Functor instance in Control.Monad.Instances, and the (->)
> e and Either e monad instances also in Control.Monad.Instances.
>
> I'm looking for something like
>
>     instance Monoid o => Monad ((,) o) where
>       return a    = (mempty,a)
>       (o,a) >>= f = (o `mappend` o', b)
>         where (o',b) = f a
>
> Where is it hiding from me?
>

http://hackage.haskell.org/packages/archive/transformers/0.2.2.0/doc/html/Control-Monad-Trans-Writer-Lazy.html#t:WriterT?

Regards,
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120111/e2266330/attachment.htm>


More information about the Haskell-Cafe mailing list