A more useful Monoid instance for Data.Map
Evan Laforge
qdunkan at gmail.com
Sat Apr 28 03:52:51 CEST 2012
> I realize that changing instances could break code, but I'd be curious to
> see how many people even use the current monoid instance. Does anyone have
> any system for testing hypotheses like this (by typechecking a large
> randomized chunk of hackage or something)?
I use both definitions. I have some data types where new values
should replace old ones, and some where the values themselves should
be joined. I do the latter with a utility function 'Map.mappend =
Map.unionWith Monoid.mappend'.
I think both definitions are useful and switching one for the other
would just break a lot of code without a lot of benefit.
More information about the Libraries
mailing list