Skip to content

Commit 4b7770a

Browse files
authored
Merge pull request #871 from meooow25/doc2
Fix misplaced findMax documentation
2 parents 5da68c0 + 545a0a0 commit 4b7770a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

containers/src/Data/Map/Internal.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,11 +1629,6 @@ findMin t
16291629
| Just r <- lookupMin t = r
16301630
| otherwise = error "Map.findMin: empty map has no minimal element"
16311631

1632-
-- | \(O(\log n)\). The maximal key of the map. Calls 'error' if the map is empty.
1633-
--
1634-
-- > findMax (fromList [(5,"a"), (3,"b")]) == (5,"a")
1635-
-- > findMax empty Error: empty map has no maximal element
1636-
16371632
lookupMaxSure :: k -> a -> Map k a -> (k, a)
16381633
lookupMaxSure k a Tip = (k, a)
16391634
lookupMaxSure _ _ (Bin _ k a _ r) = lookupMaxSure k a r
@@ -1649,6 +1644,11 @@ lookupMax :: Map k a -> Maybe (k, a)
16491644
lookupMax Tip = Nothing
16501645
lookupMax (Bin _ k x _ r) = Just $! lookupMaxSure k x r
16511646

1647+
-- | \(O(\log n)\). The maximal key of the map. Calls 'error' if the map is empty.
1648+
--
1649+
-- > findMax (fromList [(5,"a"), (3,"b")]) == (5,"a")
1650+
-- > findMax empty Error: empty map has no maximal element
1651+
16521652
findMax :: Map k a -> (k,a)
16531653
findMax t
16541654
| Just r <- lookupMax t = r

0 commit comments

Comments
 (0)