
24 Jun
2013
24 Jun
'13
4:03 p.m.
On Mon, Jun 24, 2013 at 11:53:06AM -0700, Dan Burton wrote:
If anything, the 1st instance could be a ContT instance for Monoid.
instance (Monoid r, Monad m) => Monoid (ContT r m a) where mempty = ContT $ const $ return mempty m `mappend` n = ContT $ \ c -> liftM2 mappend (runContT m c) (runContT n c)
That way both behaviors are easily accessible.
There's a school of thought that holds that the Monoid and Alternative (and therefore MonadPlus) instances on any functor should agree: http://thread.gmane.org/gmane.comp.lang.haskell.cafe/94642