[Haskell-cafe] Applicative Monoid instance
jhenahan at me.com
Mon Sep 5 19:32:42 UTC 2016
Instance overlap would break a lot of Monad instances (notably [a]),
IIRC. This instance comes up on the mailing list every two or three
years, it looks like.
There's a newtype-wrapped version of this in Control.Compose 
Brian Hurt <bhurt at spnz.org> writes:
> This may be a stupid question, but I'm wondering why the following instance
> isn't in prelude:
> instance (Applicative m, Monoid a) => Monoid (m a) where
> mempty = pure mempty
> mappend a b = mappend <$> a <*> b
> I ask, because being able to use a WriterT (IO ()) STM a to debug complex
> STM expressions would be really nice. But it depends upon IO () being a
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 800 bytes
Desc: not available
More information about the Haskell-Cafe