PROPOSAL: Add Map/IntMap newtypes for different Monoid to containers

Merijn Verstraaten merijn at inconsistent.nl
Fri Mar 24 10:36:01 UTC 2017


I would like to propose adding a newtype wrapper (with all relevant instances) for Map and IntMap (if I missed any other applicable type in containers, let me know).

This newtype should differ in Monoid/Semigroup instance from Map/IntMap by switching:

Ord k => Semigroup (Map k v)
Ord k => Monoid (Map k v)

to:

(Ord k, Semigroup v) => Semigroup (Map k v)
(Ord k, Monoid v) => Monoid (Map k v) or (Ord k, Semigroup v) => Monoid (Map k v)

Any opinions on the overall idea? Opinions on which Monoid instance? Bikeshed for the newtype names?

Cheers,
Merijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170324/c151a377/attachment-0001.sig>


More information about the Libraries mailing list