[Haskell-cafe] Applicative Monoid instance

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Mon Sep 5 20:01:06 UTC 2016


On Mon, Sep 05, 2016 at 02:54:20PM -0400, Brian Hurt 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
> 
> ?

Is 'liftA2 (<>)' not good enough?


More information about the Haskell-Cafe mailing list