remove a Set of keys from a Map
fox at ucw.cz
Sat Dec 10 14:00:24 CET 2011
> I have (x :: Set key) and (m :: Map key a) and want to remove all
> keys and corresponding values from m that are in x. I could solve it
> efficiently with a
> differenceSet :: Map key a -> Set key -> Map key a
> or with a
> Map.fromKeySet :: a -> Set key -> Map key a
> or a
> Map.fromKeySet :: (key -> a) -> Set key -> Map key a
> but I did not find one of these functions in containers-0.4.2.
Map.fromSet :: (key -> a) -> Set key -> Map key a
will very likely be available in containers-0.5.
More information about the Libraries