@@ -1811,7 +1811,7 @@ unionsWith f ts
18111811{-# INLINABLE unionsWith #-}
18121812#endif
18131813
1814- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\).
1814+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\).
18151815-- The expression (@'union' t1 t2@) takes the left-biased union of @t1@ and @t2@.
18161816-- It prefers @t1@ when duplicate keys are encountered,
18171817-- i.e. (@'union' == 'unionWith' 'const'@).
@@ -1835,7 +1835,7 @@ union t1@(Bin _ k1 x1 l1 r1) t2 = case split k1 t2 of
18351835{- -------------------------------------------------------------------
18361836 Union with a combining function
18371837--------------------------------------------------------------------}
1838- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Union with a combining function.
1838+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Union with a combining function.
18391839--
18401840-- > unionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "aA"), (7, "C")]
18411841
@@ -1855,7 +1855,7 @@ unionWith f (Bin _ k1 x1 l1 r1) t2 = case splitLookup k1 t2 of
18551855{-# INLINABLE unionWith #-}
18561856#endif
18571857
1858- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\).
1858+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\).
18591859-- Union with a combining function.
18601860--
18611861-- > let f key left_value right_value = (show key) ++ ":" ++ left_value ++ "|" ++ right_value
@@ -1886,7 +1886,7 @@ unionWithKey f (Bin _ k1 x1 l1 r1) t2 = case splitLookup k1 t2 of
18861886-- relies on doing it the way we do, and it's not clear whether that
18871887-- bound holds the other way.
18881888
1889- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Difference of two maps.
1889+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Difference of two maps.
18901890-- Return elements of the first map not existing in the second map.
18911891--
18921892-- > difference (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == singleton 3 "b"
@@ -1905,7 +1905,7 @@ difference t1 (Bin _ k _ l2 r2) = case split k t1 of
19051905{-# INLINABLE difference #-}
19061906#endif
19071907
1908- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Remove all keys in a 'Set' from a 'Map'.
1908+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Remove all keys in a 'Set' from a 'Map'.
19091909--
19101910-- @
19111911-- m \`withoutKeys\` s = 'filterWithKey' (\\k _ -> k ``Set.notMember`` s) m
@@ -1964,7 +1964,7 @@ differenceWithKey f =
19641964{- -------------------------------------------------------------------
19651965 Intersection
19661966--------------------------------------------------------------------}
1967- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Intersection of two maps.
1967+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Intersection of two maps.
19681968-- Return data in the first map for the keys existing in both maps.
19691969-- (@'intersection' m1 m2 == 'intersectionWith' 'const' m1 m2@).
19701970--
@@ -1986,7 +1986,7 @@ intersection t1@(Bin _ k x l1 r1) t2
19861986{-# INLINABLE intersection #-}
19871987#endif
19881988
1989- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Restrict a 'Map' to only those keys
1989+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Restrict a 'Map' to only those keys
19901990-- found in a 'Set'.
19911991--
19921992-- @
@@ -2011,7 +2011,7 @@ restrictKeys m@(Bin _ k x l1 r1) s
20112011{-# INLINABLE restrictKeys #-}
20122012#endif
20132013
2014- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Intersection with a combining function.
2014+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Intersection with a combining function.
20152015--
20162016-- > intersectionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == singleton 5 "aA"
20172017
@@ -2031,7 +2031,7 @@ intersectionWith f (Bin _ k x1 l1 r1) t2 = case mb of
20312031{-# INLINABLE intersectionWith #-}
20322032#endif
20332033
2034- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Intersection with a combining function.
2034+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Intersection with a combining function.
20352035--
20362036-- > let f k al ar = (show k) ++ ":" ++ al ++ "|" ++ ar
20372037-- > intersectionWithKey f (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == singleton 5 "5:a|A"
@@ -2053,7 +2053,7 @@ intersectionWithKey f (Bin _ k x1 l1 r1) t2 = case mb of
20532053{- -------------------------------------------------------------------
20542054 Disjoint
20552055--------------------------------------------------------------------}
2056- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Check whether the key sets of two
2056+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Check whether the key sets of two
20572057-- maps are disjoint (i.e., their 'intersection' is empty).
20582058--
20592059-- > disjoint (fromList [(2,'a')]) (fromList [(1,()), (3,())]) == True
@@ -2752,7 +2752,7 @@ mergeWithKey f g1 g2 = go
27522752{- -------------------------------------------------------------------
27532753 Submap
27542754--------------------------------------------------------------------}
2755- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\).
2755+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\).
27562756-- This function is defined as (@'isSubmapOf' = 'isSubmapOfBy' (==)@).
27572757--
27582758isSubmapOf :: (Ord k ,Eq a ) => Map k a -> Map k a -> Bool
@@ -2761,7 +2761,7 @@ isSubmapOf m1 m2 = isSubmapOfBy (==) m1 m2
27612761{-# INLINABLE isSubmapOf #-}
27622762#endif
27632763
2764- {- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\).
2764+ {- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\).
27652765 The expression (@'isSubmapOfBy' f t1 t2@) returns 'True' if
27662766 all keys in @t1@ are in tree @t2@, and when @f@ returns 'True' when
27672767 applied to their respective values. For example, the following
@@ -2810,7 +2810,7 @@ submap' f (Bin _ kx x l r) t
28102810{-# INLINABLE submap' #-}
28112811#endif
28122812
2813- -- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Is this a proper submap? (ie. a submap but not equal).
2813+ -- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Is this a proper submap? (ie. a submap but not equal).
28142814-- Defined as (@'isProperSubmapOf' = 'isProperSubmapOfBy' (==)@).
28152815isProperSubmapOf :: (Ord k ,Eq a ) => Map k a -> Map k a -> Bool
28162816isProperSubmapOf m1 m2
@@ -2819,7 +2819,7 @@ isProperSubmapOf m1 m2
28192819{-# INLINABLE isProperSubmapOf #-}
28202820#endif
28212821
2822- {- | \(O\bigl(m \log\bigl(\frac{n+1 }{m+1} \bigr)\bigr), \; m \leq n\). Is this a proper submap? (ie. a submap but not equal).
2822+ {- | \(O\bigl(m \log\bigl(\frac{n}{m}+1 \bigr)\bigr), \; 0 < m \leq n\). Is this a proper submap? (ie. a submap but not equal).
28232823 The expression (@'isProperSubmapOfBy' f m1 m2@) returns 'True' when
28242824 @keys m1@ and @keys m2@ are not equal,
28252825 all keys in @m1@ are in @m2@, and when @f@ returns 'True' when
0 commit comments