Proposal: Add missing Monoid for ZipList

Mario Blažević blamario at
Sun Jul 26 13:18:46 UTC 2015

On 07/25/2015 05:13 PM, David Feuer wrote:
> We could add a newtype for this in Data.Monoid.
> newtype Appl f a = Appl (f a)
> instance (Applicative f, Monoid a) => Monoid (Appl f a) where
>   mempty = Appl $ pure mempty
>   mplus (Appl x) (Appl y) = Appl $ liftA2 mplus x y

     I like this idea, it would go well with the recently-added Alt 
newtype. You should make it a separate proposal, though. I'm +0 on the 
parent proposal.

More information about the Libraries mailing list