-
Notifications
You must be signed in to change notification settings - Fork 129
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
feat(difference, intersection): add multiset variants #636
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5f07e7e:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's include an example with duplicate values to illustrate the difference?
src/difference.ts
Outdated
@@ -5,7 +5,7 @@ import { purry } from "./purry"; | |||
/** | |||
* Excludes the values from `other` array. | |||
* | |||
* ! **DEPRECATED**: Use `R.filter(array, R.isNot(R.isIncludedIn(other)))`. Will be removed in v2! | |||
* ! **DEPRECATED**: The runtime implementation of this function handles duplicate values inconsistently. In v2 a new implementation would replace it; this implementation is accessible to v1 users via the `multiset` variant of this function (`R.difference.multiset`), or to maintain the same runtime implementation use `R.filter(array, R.isNot(R.isIncludedIn(other)))` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion:
* ! **DEPRECATED**: The runtime implementation of this function handles duplicate values inconsistently. In v2 a new implementation would replace it; this implementation is accessible to v1 users via the `multiset` variant of this function (`R.difference.multiset`), or to maintain the same runtime implementation use `R.filter(array, R.isNot(R.isIncludedIn(other)))` instead. | |
* ! **DEPRECATED**: In v2, `R.difference.multiset` will replace `R.difference`. To keep current behavior, use `R.filter(array, R.isNot(R.isIncludedIn(other)))` instead. |
c8c5e28
to
dcecc69
Compare
0685b81
to
5f07e7e
Compare
hooray 🎉 does this make #368 no longer needed? are multiset semantics going to be our default moving-forward, and does that mean we want the other multiset helpers, or what? |
Other utilities we don't offer or don't offer correctly would need to be ported, too. For now, it's a good template for me to copy from and a reminder to do it. |
🎉 This PR is included in version 1.60.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adding a variant difference for multiset semantics and update the deprecation warning.