These functions could in theory accept:
- single Set
- best possible performance
- requires user to convert iterables to Sets before passing
- multiple Sets
- looks like rare use case
- Single iterable
- Consistent with other languages (eg. LINQ
.intersect
method)
- Consistent with other languages (eg. LINQ
- Multiple iterables
- Used by Immutable.js
- Certain algorithms can be ineffective without converting arguments to
Set
instances (intersection
without at leastlog(n)
random access seems to be too slow for real world)
Currently this proposal takes the "single Set" option. See details.md for details of this and other decisions.