
27 Apr
2012
27 Apr
'12
9:52 p.m.
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.