Skip to content

Commit 13d2a41

Browse files
authored
Use consistent notation for complexity annotation (#729)
1 parent 4e09df7 commit 13d2a41

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

containers/src/Data/IntMap/Internal.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,12 @@ disjoint t1@(Bin p1 m1 l1 r1) t2@(Bin p2 m2 l2 r2)
771771
{--------------------------------------------------------------------
772772
Compose
773773
--------------------------------------------------------------------}
774-
-- | /O(|ab|*min(|bc|,W))/. Relate the keys of one map to the values of
774+
-- | Relate the keys of one map to the values of
775775
-- the other, by using the values of the former as keys for lookups
776776
-- in the latter.
777777
--
778+
-- Complexity: \( O(n * \min(m,W)) \), where \(m\) is the size of the first argument
779+
--
778780
-- > compose (fromList [('a', "A"), ('b', "B")]) (fromList [(1,'a'),(2,'b'),(3,'z')]) = fromList [(1,"A"),(2,"B")]
779781
--
780782
-- @

containers/src/Data/IntMap/Strict/Internal.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,10 +721,12 @@ intersectionWithKey f m1 m2
721721
{--------------------------------------------------------------------
722722
Compose
723723
--------------------------------------------------------------------}
724-
-- | /O(|ab|*min(|bc|,W))/. Relate the keys of one map to the values of
724+
-- | Relate the keys of one map to the values of
725725
-- the other, by using the values of the former as keys for lookups
726726
-- in the latter.
727727
--
728+
-- Complexity: \( O(n * \min(m,W)) \), where \(m\) is the size of the first argument
729+
--
728730
-- > compose (fromList [('a', "A"), ('b', "B")]) (fromList [(1,'a'),(2,'b'),(3,'z')]) = fromList [(1,"A"),(2,"B")]
729731
--
730732
-- @

containers/src/Data/Map/Internal.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2094,10 +2094,12 @@ disjoint (Bin _ k _ l r) t
20942094
{--------------------------------------------------------------------
20952095
Compose
20962096
--------------------------------------------------------------------}
2097-
-- | /O(|ab|*log(|bc|))/. Relate the keys of one map to the values of
2097+
-- | Relate the keys of one map to the values of
20982098
-- the other, by using the values of the former as keys for lookups
20992099
-- in the latter.
21002100
--
2101+
-- Complexity: \( O (n * \log(m)) \), where \(m\) is the size of the first argument
2102+
--
21012103
-- > compose (fromList [('a', "A"), ('b', "B")]) (fromList [(1,'a'),(2,'b'),(3,'z')]) = fromList [(1,"A"),(2,"B")]
21022104
--
21032105
-- @

containers/src/Data/Map/Strict/Internal.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,10 +1206,12 @@ forceMaybe m@(Just !_) = m
12061206
{--------------------------------------------------------------------
12071207
Compose
12081208
--------------------------------------------------------------------}
1209-
-- | /O(|ab|*log(|bc|))/. Relate the keys of one map to the values of
1209+
-- | Relate the keys of one map to the values of
12101210
-- the other, by using the values of the former as keys for lookups
12111211
-- in the latter.
12121212
--
1213+
-- Complexity: \( O (n * \log(m)) \), where \(m\) is the size of the first argument
1214+
--
12131215
-- > compose (fromList [('a', "A"), ('b', "B")]) (fromList [(1,'a'),(2,'b'),(3,'z')]) = fromList [(1,"A"),(2,"B")]
12141216
--
12151217
-- @

0 commit comments

Comments
 (0)