Description
There seems to be a small difference in the behaviour of Set.from{Asc,Desc}List
between containers-0.7
and containers-0.8
, specifically when these functions are applied to lists with duplicate elements.
- In
containers-0.7
these functions keep the first of any duplicates. - In
containers-0.8
these functions keep the last of any duplicates.
I'm guessing the change was introduced in #1083, which fixes #1032.
As I understand it, this change makes the behaviour of Set.from{Asc,Desc}List
more consistent with the equivalent Map.from{Asc,Desc}List
functions, which seems very reasonable!
Though perhaps we could add something about this to the changelog for 0.8
? (Even though this behaviour was previously unspecified!)
Perhaps something like this:
Breaking changes
- The
fromAscList
andfromDescList
functions forSet
, when applied to lists with duplicate elements, now keep the last of any duplicates. This is a change from the behaviour ofcontainers-0.7
, where these functions would keep the first of any duplicates. The new behaviour is now consistent with the equivalent functions forMap
, which also keep the last of any key-value mappings that share a duplicate key.
If people are happy with this wording (or similar), I'd be happy to create a PR to add it.
I ran into this while looking at nonempty-containers
, which is affected by this change. See:
- Support for
containers-0.8
. mstksg/nonempty-containers#17 (comment) - Support for
containers-0.8
. mstksg/nonempty-containers#17 (comment)
I'm guessing that other downstream libraries could also be affected. (But I don't currently have other examples to share.)