purescript-deprecated/purescript-maps

Semigroup instance for Map k v?

Closed this issue · 4 comments

with (<>) = union, like Haskell does? I'll prepare a PR if you think this is a good idea.

see https://downloads.haskell.org/~ghc/latest/docs/html/libraries/containers/src/Data-Map-Base.html#line-334

Oh, sorry, I guess that should be (Ord k) => Semigroup (Map k v)

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

Personally, I think the (<>) = union instance is a more natural default, and we can always newtype for other instances.

resolved via #25