We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This would make it easy to convert from/to native types. fromIterable would cover any instance w/ Symbol.iterator on it.
fromIterable
Symbol.iterator
toNativeSet would be a convenience function nearly identical to toArray.
toNativeSet
toArray
Another option would be to make the set types iterable. Then you could just do:
const nativeDifference = fromNative => toNative => a => pipe([ fromNative, curry2(difference)(fromNative(a)), toNative]); const nativeDifference2 = toNative => a => pipe([ BaseSet.fromIterable, curry2(difference)(BaseSet.fromIterable(a), toNative]); const arrayDifference = nativeDifference(BaseSet.fromFoldable)(BaseSet.toArray); const setDifference = nativeDifference( compose(BaseSet.fromFoldable, Array.from))(s => new Set(BaseSet.toArray(s))); const arrayDifference2 = nativeDifference2(Array.from); const setDifference2 = nativeDifference2(s => new Set(s));
The text was updated successfully, but these errors were encountered:
Leveraging Symbol.iterator as a default to deal with lists would probably be the best way for polymorphic reasons...even ImmutableJS uses them...
I mean: all data types that implement list-like should be implemented using iterator.
Sorry, something went wrong.
No branches or pull requests
This would make it easy to convert from/to native types.
fromIterable
would cover any instance w/Symbol.iterator
on it.toNativeSet
would be a convenience function nearly identical totoArray
.Another option would be to make the set types iterable. Then you could just do:
The text was updated successfully, but these errors were encountered: