[Haskell-cafe] Applicative Monoid instance
hesselink at gmail.com
Tue Sep 6 09:07:11 UTC 2016
I believe this is the App newtype in the monoids package .
On 5 September 2016 at 20:54, Brian Hurt <bhurt at spnz.org> wrote:
> 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 --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe