Expand the Data.Set API

Casey McCann cam at uptoisomorphism.net
Fri Mar 6 00:17:55 UTC 2015


On Thu, Mar 5, 2015 at 5:59 PM, David Feuer <david.feuer at gmail.com> wrote:
> There are a few rather conspicuously missing features:
>
> 1. A way to take the intersection of a list of sets. This shouldn't
> really be a big deal, and it already exists for unions, but the
> intersection version should probably sort the sets by size before
> folding, or otherwise try to do something smart.

Incidentally, having "unions" but not "intersections" is also true of
IntSet, Map, and IntMap. Adding it to all would probably be good for
consistency if nothing else, unless there's some reason not to.

> 3. A way to delete an element and simultaneously find out whether it
> was in the set.

Likewise here, I believe, though I may be forgetting something.

I'm pretty sure your second point is only missing-but-useful for
Data.Set, though.

- C.


More information about the Libraries mailing list