[Haskell-cafe] Why there is not standard Monoid instance for ZipList a?

Job Vranish jvranish at gmail.com
Fri Oct 16 08:56:28 EDT 2009

Other than possibly adding library clutter.

I have a package that provides many instances and common functions for
ZipLists. Eventually I might stick it on hackage, but currently it's here:

I really with there was a way to switch Applicative (or other) instances for
list (or other) types.
Then we wouldn't have this problem.

- Job

On Fri, Oct 16, 2009 at 5:52 AM, Vladimir Reshetnikov <
v.reshetnikov at gmail.com> wrote:

> I find the following instance very convenient:
> ------------------------------------------------------------------------
> import Data.Monoid
> import Control.Applicative
> instance Monoid a => Monoid (ZipList a) where
>   mempty = pure mempty
>   mappend = liftA2 mappend
> ------------------------------------------------------------------------
> Any reason why it is not in the standard library?
> Thanks,
> Vladimir
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091016/2642c704/attachment.html

More information about the Haskell-Cafe mailing list