Proposal: Remove Semigroup and Monoid instances for Data.Map, Data.IntMap, Data.HashMap

Chris Wong lambda.fairy at
Tue Feb 13 19:51:16 UTC 2018

Hi David,

On Feb 14, 2018 08:34, "David Feuer" <david.feuer at> wrote:


1. Remove the instances but don't add the new ones. I fear this may
lead others to write their own orphan instances, which may not even
all do the same thing.

2. Write separate modules with newtype-wrapped versions of the data
structures implementing the desired instances. Unfortunately, this
would be annoying to maintain, and also annoying to use--packages
using the unwrapped and wrapped versions will use different types.
Manually wrapping and unwrapping to make the different types work with
each other will introduce lots of potential for mistakes and

A third alternative is to "poison" the instances by placing TypeError in
their constraints. This would prevent users from writing orphan instances,
as they would overlap with the poisoned ones.

On other Haskell implementations (if we still support them), we can use a
private class with no instances for this purpose.



Discussion period: three weeks.

Libraries mailing list
Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list