[Haskell-cafe] monoids and monads
jwlato at gmail.com
Mon Jul 26 11:55:45 EDT 2010
I was wondering today, is this generally true?
instance (Monad m, Monoid a) => Monoid (m a) where
mempty = return mempty
mappend = liftM2 mappend
I know it isn't a good idea to use this instance, but assuming that
the instance head does what I mean, is it valid? Or more generally is
it true for applicative functors as well? I think it works for a few
tricky monads, but that's not any sort of proof. I don't even know
how to express what would need to be proven here.
Any resources for how I could develop a means to reason about this
sort of property?
More information about the Haskell-Cafe