-
Notifications
You must be signed in to change notification settings - Fork 180
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
Add symmetric difference ops #1009
Conversation
...for Set, Map, IntSet, IntMap. This joins the set operations already implemented: union, intersection, difference.
@treeowl any concerns about adding these operations? symmetricDifference :: Ord a => Set a -> Set a -> Set a
symmetricDifference :: Ord k => Map k a -> Map k a -> Map k a
symmetricDifference :: IntSet -> IntSet -> IntSet
symmetricDifference :: IntMap a -> IntMap a -> IntMap a |
I agree these might be useful. It's still an extra maintenance burden. (I am not a maintainer, and I am eternally grateful to those who are, but do I worry about their resources.) Can these functions not be implemented with https://hackage.haskell.org/package/containers-0.7/docs/Data-Map-Strict.html#v:mergeWithKey (and similar)? Did you do, did you compare performance? If the answer would be that |
@jwaldmann , I would look to |
I don't think that is the case. These are straightforward implementations. We already have
These operations would more likely be used for sets (as mentioned in #1002), and there is no For
|
I don't object to adding these. I do want to get |
@treeowl should we merge this then? |
Yeah, I'd say go ahead. |
If those branches are a performance issue, we should probably rewrite |
That's true, we need them in |
...for Set, Map, IntSet, IntMap. This joins the set operations already implemented: union, intersection, difference.
Closes #1002.