Hi,
If you compare this with the Monoid for Maybe, it's like we're defaulting to First as the monoid instance for maps.
A more useful instance, however very much a breaking change, would be to make the instance depend on a Monoid (or better yet, a Semigroup) for the values in the map:
instance Monoid v => Monoid (Map k v) where
mappend = unionWith mappend
This lets us build up maps with values in a useful Monoid, and mappend them with gusto.
Thoughts?
- Nick Partridge
Discussion period: 2 weeks.