From 28effeb33421aaf0f160073d36ef7da7570ed169 Mon Sep 17 00:00:00 2001 From: ross Date: Tue, 18 Jan 2005 11:23:35 +0000 Subject: [PATCH] [project @ 2005-01-18 11:23:35 by ross] generalize the types of intersectionWith and intersectionWithKey --- Data/Map.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 1.7.10.4