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?

Thanks, - Conal
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to