Skip to content

Commit 03e5a6e

Browse files
committed
Change example to not be contrived due to a duplicate value
1 parent 5aec998 commit 03e5a6e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

containers/src/Data/Map/Internal.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3795,9 +3795,9 @@ fromDescListWith f xs
37953795
-- if the precondition may not hold.
37963796
--
37973797
-- > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2
3798-
-- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")] == fromList [(3, "b"), (5, "5:b5:ba")]
3799-
-- > valid (fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")]) == True
3800-
-- > valid (fromAscListWithKey f [(5,"a"), (3,"b"), (5,"b"), (5,"b")]) == False
3798+
-- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"c")] == fromList [(3, "b"), (5, "5:c5:ba")]
3799+
-- > valid (fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"c")]) == True
3800+
-- > valid (fromAscListWithKey f [(5,"a"), (3,"b"), (5,"b"), (5,"c")]) == False
38013801
--
38023802
-- Also see the performance note on 'fromListWith'.
38033803

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,9 +1661,9 @@ fromDescListWith f xs
16611661
-- if the precondition may not hold.
16621662
--
16631663
-- > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2
1664-
-- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")] == fromList [(3, "b"), (5, "5:b5:ba")]
1665-
-- > valid (fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")]) == True
1666-
-- > valid (fromAscListWithKey f [(5,"a"), (3,"b"), (5,"b"), (5,"b")]) == False
1664+
-- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"c")] == fromList [(3, "b"), (5, "5:c5:ba")]
1665+
-- > valid (fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"c")]) == True
1666+
-- > valid (fromAscListWithKey f [(5,"a"), (3,"b"), (5,"b"), (5,"c")]) == False
16671667
--
16681668
-- Also see the performance note on 'fromListWith'.
16691669

0 commit comments

Comments
 (0)