-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ base ] Add unambiguous kvList
functions for sorted maps
#3392
base: main
Are you sure you want to change the base?
Conversation
b8b7bb2
to
3e15034
Compare
There is a |
I thought about that but 1) I didn't come up with a better name 2) I thought this may be a too much change which would probably be discarded because of the size. For instance, this would change even the |
I'm not sure I like the renaming of I get the argument that it is unfortunate to have a collision of names with Just my $0.02 though. I'm not at all opposed to deprecating and removing any specialized implementation that is identical to the generic one (re |
Looks like it's okay to make
I did #3425 for this |
3e15034
to
1cf6738
Compare
toList
functions for sorted sets and mapskvList
functions for sorted maps
After critics above and since #3425 is merged, I've changed this PR to be just an addition of a |
Description
Both
Data.SortedMap
andData.SortedSet
have specialisedtoList
functions.ForData.SortedSet
, I think this is a historical curious case, since its signature and semantics completely copiestoList
fromPrelude
, namely fromFoldable
, which is implemented bySortedSet
. I suggest to remove this completely in the future, but suggest now to deprecate this function in favor ofprelude
's one for backward compatibility.For
Data.SortedMap
,toList
has different meaning comparing to the one fromFoldable
, whileFoldable
is indeed implemented bySortedMap
, havingPrelude.toList
to list all the values, whileSortedMap.toList
listing all key-value pairs stored in the map. I think having two functions with the same name having different meaning is not a good thing, plus you need to specify namespace each time you usetoList
for maps (whichever you use). I suggest to introduce a new function for listing key-value pairs list, namelykvList
,and to deprecate special key-value.toList
function in favor of the new oneTo be clear: this PR is a backward-compatible change, but it adds several deprecation warnings, and I suggest the breaking change after the next release (namely, removing deprecated functions).UPD: I've striked out some outdated text after a bit of discussion and another PR being merged.
Should this change go in the CHANGELOG?
implementation, I have updated
CHANGELOG_NEXT.md
(and potentially alsoCONTRIBUTORS.md
).