intersectionSet, differenceSet

Henning Thielemann lemming at
Thu Nov 15 23:05:28 CET 2012

On Thu, 15 Nov 2012, Andreas Abel wrote:

> Sounds ok, by why especially for Set.  Why not (also)
>    Map.intersectionList :: Ord k => Map k a -> [k] -> Map k a
>    Map.differenceList :: Ord k => Map k a -> [k] -> Map k a
> ? Screams for a generalization.

I assume that Map.differenceSet can make use of the internal tree 
structure of a set and is thus more efficient. The documentation of 
Map.difference says it uses an adaption of hedge-union and this could also 
be used for Map.differenceSet.

More information about the Libraries mailing list