Why there is not standard Monoid instance for ZipList a?

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

Nope, 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: http://github.com/jvranish/ZipList 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@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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Job Vranish
-
Vladimir Reshetnikov