X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=Data%2FMap.hs;h=4635bf450c785058575331cf65506dfca47b0b1e;hb=28effeb33421aaf0f160073d36ef7da7570ed169;hp=b23880a1a3a47ef08c007432bae378a3c8425253;hpb=7d4e0922dd95d5a72d02ecc865598f1ce86aa48d;p=ghc-base.git diff --git a/Data/Map.hs b/Data/Map.hs index b23880a..4635bf4 100644 --- a/Data/Map.hs +++ b/Data/Map.hs @@ -625,13 +625,13 @@ intersection m1 m2 = intersectionWithKey (\k x y -> x) m1 m2 -- | /O(n+m)/. Intersection with a combining function. -intersectionWith :: Ord k => (a -> b -> a) -> Map k a -> Map k b -> Map k a +intersectionWith :: Ord k => (a -> b -> c) -> Map k a -> Map k b -> Map k c intersectionWith f m1 m2 = intersectionWithKey (\k x y -> f x y) m1 m2 -- | /O(n+m)/. Intersection with a combining function. -- Intersection is more efficient on (bigset `intersection` smallset) -intersectionWithKey :: Ord k => (k -> a -> b -> a) -> Map k a -> Map k b -> Map k a +intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c intersectionWithKey f Tip t = Tip intersectionWithKey f t Tip = Tip intersectionWithKey f t1 t2