@@ -1811,7 +1811,7 @@ unionsWith f ts
1811
1811
{-# INLINABLE unionsWith #-}
1812
1812
#endif
1813
1813
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\).
1815
1815
-- The expression (@'union' t1 t2@) takes the left-biased union of @t1@ and @t2@.
1816
1816
-- It prefers @t1@ when duplicate keys are encountered,
1817
1817
-- i.e. (@'union' == 'unionWith' 'const'@).
@@ -1835,7 +1835,7 @@ union t1@(Bin _ k1 x1 l1 r1) t2 = case split k1 t2 of
1835
1835
{- -------------------------------------------------------------------
1836
1836
Union with a combining function
1837
1837
--------------------------------------------------------------------}
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.
1839
1839
--
1840
1840
-- > unionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == fromList [(3, "b"), (5, "aA"), (7, "C")]
1841
1841
@@ -1855,7 +1855,7 @@ unionWith f (Bin _ k1 x1 l1 r1) t2 = case splitLookup k1 t2 of
1855
1855
{-# INLINABLE unionWith #-}
1856
1856
#endif
1857
1857
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\).
1859
1859
-- Union with a combining function.
1860
1860
--
1861
1861
-- > 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
1886
1886
-- relies on doing it the way we do, and it's not clear whether that
1887
1887
-- bound holds the other way.
1888
1888
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.
1890
1890
-- Return elements of the first map not existing in the second map.
1891
1891
--
1892
1892
-- > 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
1905
1905
{-# INLINABLE difference #-}
1906
1906
#endif
1907
1907
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'.
1909
1909
--
1910
1910
-- @
1911
1911
-- m \`withoutKeys\` s = 'filterWithKey' (\\k _ -> k ``Set.notMember`` s) m
@@ -1964,7 +1964,7 @@ differenceWithKey f =
1964
1964
{- -------------------------------------------------------------------
1965
1965
Intersection
1966
1966
--------------------------------------------------------------------}
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.
1968
1968
-- Return data in the first map for the keys existing in both maps.
1969
1969
-- (@'intersection' m1 m2 == 'intersectionWith' 'const' m1 m2@).
1970
1970
--
@@ -1986,7 +1986,7 @@ intersection t1@(Bin _ k x l1 r1) t2
1986
1986
{-# INLINABLE intersection #-}
1987
1987
#endif
1988
1988
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
1990
1990
-- found in a 'Set'.
1991
1991
--
1992
1992
-- @
@@ -2011,7 +2011,7 @@ restrictKeys m@(Bin _ k x l1 r1) s
2011
2011
{-# INLINABLE restrictKeys #-}
2012
2012
#endif
2013
2013
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.
2015
2015
--
2016
2016
-- > intersectionWith (++) (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == singleton 5 "aA"
2017
2017
@@ -2031,7 +2031,7 @@ intersectionWith f (Bin _ k x1 l1 r1) t2 = case mb of
2031
2031
{-# INLINABLE intersectionWith #-}
2032
2032
#endif
2033
2033
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.
2035
2035
--
2036
2036
-- > let f k al ar = (show k) ++ ":" ++ al ++ "|" ++ ar
2037
2037
-- > 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
2053
2053
{- -------------------------------------------------------------------
2054
2054
Disjoint
2055
2055
--------------------------------------------------------------------}
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
2057
2057
-- maps are disjoint (i.e., their 'intersection' is empty).
2058
2058
--
2059
2059
-- > disjoint (fromList [(2,'a')]) (fromList [(1,()), (3,())]) == True
@@ -2752,7 +2752,7 @@ mergeWithKey f g1 g2 = go
2752
2752
{- -------------------------------------------------------------------
2753
2753
Submap
2754
2754
--------------------------------------------------------------------}
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\).
2756
2756
-- This function is defined as (@'isSubmapOf' = 'isSubmapOfBy' (==)@).
2757
2757
--
2758
2758
isSubmapOf :: (Ord k ,Eq a ) => Map k a -> Map k a -> Bool
@@ -2761,7 +2761,7 @@ isSubmapOf m1 m2 = isSubmapOfBy (==) m1 m2
2761
2761
{-# INLINABLE isSubmapOf #-}
2762
2762
#endif
2763
2763
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\).
2765
2765
The expression (@'isSubmapOfBy' f t1 t2@) returns 'True' if
2766
2766
all keys in @t1@ are in tree @t2@, and when @f@ returns 'True' when
2767
2767
applied to their respective values. For example, the following
@@ -2810,7 +2810,7 @@ submap' f (Bin _ kx x l r) t
2810
2810
{-# INLINABLE submap' #-}
2811
2811
#endif
2812
2812
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).
2814
2814
-- Defined as (@'isProperSubmapOf' = 'isProperSubmapOfBy' (==)@).
2815
2815
isProperSubmapOf :: (Ord k ,Eq a ) => Map k a -> Map k a -> Bool
2816
2816
isProperSubmapOf m1 m2
@@ -2819,7 +2819,7 @@ isProperSubmapOf m1 m2
2819
2819
{-# INLINABLE isProperSubmapOf #-}
2820
2820
#endif
2821
2821
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).
2823
2823
The expression (@'isProperSubmapOfBy' f m1 m2@) returns 'True' when
2824
2824
@keys m1@ and @keys m2@ are not equal,
2825
2825
all keys in @m1@ are in @m2@, and when @f@ returns 'True' when
0 commit comments