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

Herbert Valerio Riedel hvriedel at gmail.com
Tue Feb 13 22:28:37 UTC 2018


David,


On 2018-02-13 at 14:33:45 -0500, David Feuer wrote:

[...]

> 1. Deprecate the Semigroup and Monoid instances for Data.Map.Map,
> Data.IntMap.IntMap, and Data.HashMap.HashMap in the next releases of
> containers and unordered-containers.
>
> 2. Remove the deprecated instances.
>
> 3. After another several years (four or five, perhaps?), make a major
> release of each package in which the instances are replaced with the
> following:

Why does this need to be a such a dreadfully long-winded process? All we
need is a way to somehow signal a semantic change in the exposed API --
and it turns out that we actually already have the technology for this!

This is exactly one of the core ideas of "semantic versioning" (as a
dep-solver-computation-friendly proxy for machine-checkable formal API
contracts...) and it's got even "semantic" in its name!


In other words, the proposal can be greatly simplified to


1. Make a new major release (or maybe even make it a super-major
   release, i.e. to `containers-1.0.0.0` for extra saliency) replacing
   the instances with the more desirable ones; describe the change
   prominently in the changelog.


Profit!


Life's short; do we really need a multi-generational journey where the
original supporters may not even be around anymore to see the proposal
reach its final destination... ;-)


Cheers,
  HVR


More information about the Libraries mailing list