Symmetric difference for Set and IntSet

Simon Jakobi simon.jakobi at
Wed Jun 17 20:35:46 UTC 2020


Symmetric difference has previously briefly come up on the containers
issue tracker:

David mentions the idea of a generalized merge API similarly to the
one for Map and IntMap there, which would be nice to have now. Not a
prerequisite for the addition though IMHO.

Am Mi., 17. Juni 2020 um 21:25 Uhr schrieb Andrew Lelechenko
<andrew.lelechenko at>:
> Hi all,
> I propose to add a new combining function to `Data.Set` and `Data.IntSet` with the following semantics (but better implementation):
> symmetricDifference :: Set a -> Set a -> Set a
> symmetricDifference x y = (x \\ y) <> (y \\ x)
> The context is that Federico (CC'ed) is working on a GSoC project about faster factorisation algorithms in `arithmoi` (, and the symmetric difference is a basic building block for sparse linear algebra over GF(2) field.
> Best regards,
> Andrew
> _______________________________________________
> Libraries mailing list
> Libraries at

More information about the Libraries mailing list