Semigroup instance for Map k v?
Closed this issue · 4 comments
hdgarrood commented
with (<>) = union, like Haskell does? I'll prepare a PR if you think this is a good idea.
hdgarrood commented
Oh, sorry, I guess that should be (Ord k) => Semigroup (Map k v)
hdgarrood commented
Actually I've thought of another potential instance - (Ord k, Semigroup v) => Semigroup (Map k v) where (<>) = unionWith (<>), using the unionWith from Haskell's Data.Map
paf31 commented
Personally, I think the (<>) = union instance is a more natural default, and we can always newtype for other instances.