[Haskell-cafe] Symmetric Difference for Data.Set and Data.IntSet?
clintonmead at gmail.com
Mon Jun 22 04:35:36 UTC 2015
I think he means
symmetricDifference a b = (a `union` b) `difference` (a `intersection` b)
symmetricDifference a b = (a `difference` b) `union` (b `difference` a)
Basically the elements in one of the two sets but not both. He's claiming a
direct function would be faster than combining three.
Note that (a `difference` b \= b `difference` a) but (a
`symmetricDifference` b == b `symmetricDifference` a).
On Sun, Jun 21, 2015 at 3:15 PM, Ruben Astudillo <ruben.astud at gmail.com>
> On 20/06/15 21:49, Zemyla wrote:
>> Alternatively, could we get a merge interface for Set and IntSet roughly
>> matching Map and IntMap?
> Could you expand on what you mean? I understand it as that having
> operations of
> (Int)Map for (Int)Set, why don't just use (Int)Map then?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe