Proposal: Add missing Monoid for ZipList

Roman Cheplyaka roma at ro-che.info
Sat Jul 25 21:45:09 UTC 2015


This is a neat idea, and potentially useful. +1.

If this gets through, the instance should include documentation
describing how it works (probably mentioning zipWith) and contrasting it
with the Monoid [a] instance.

On 25/07/15 23:50, Christopher Allen wrote:
> http://hackage.haskell.org/package/base-4.8.1.0/docs/Control-Applicative.html#t:ZipList
> 
> There's a Monoid that matches what the Applicative for ZipList does that
> seems to be missing.
> 
> instance Monoid a => Monoid (ZipList a) where
>   mempty  = pure mempty
>   mappend = liftA2 mappend
> 
> It's been brought up before:
> 
> https://mail.haskell.org/pipermail/haskell-cafe/2009-October/067861.html
> 
> Not only is it useful when it's the Monoid you want, but it serves an
> educational purpose for highlighting the relationship between Monoid and
> Applicative as well.
> 
> Are there any good reasons not to have it?
> 
> I'd like to limit discussion to two weeks.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150726/3ce8d475/attachment.sig>


More information about the Libraries mailing list