Skip to content

Commit

Permalink
Improve docs of mapKeys.
Browse files Browse the repository at this point in the history
The problem found out when improving tests.
  • Loading branch information
foxik committed Nov 23, 2011
1 parent 63f2112 commit 820efd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Data/Map/Base.hs
Expand Up @@ -1598,8 +1598,8 @@ mapAccumRWithKey f a (Bin sx kx x l r) =
-- @'mapKeys' f s@ is the map obtained by applying @f@ to each key of @s@.
--
-- The size of the result may be smaller if @f@ maps two or more distinct
-- keys to the same new key. In this case the value at the smallest of
-- these keys is retained.
-- keys to the same new key. In this case the value at the greatest of the
-- original keys is retained.
--
-- > mapKeys (+ 1) (fromList [(5,"a"), (3,"b")]) == fromList [(4, "b"), (6, "a")]
-- > mapKeys (\ _ -> 1) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")]) == singleton 1 "c"
Expand Down
4 changes: 2 additions & 2 deletions Data/Map/Strict.hs
Expand Up @@ -978,8 +978,8 @@ mapAccumRWithKey f a (Bin sx kx x l r) =
-- @'mapKeys' f s@ is the map obtained by applying @f@ to each key of @s@.
--
-- The size of the result may be smaller if @f@ maps two or more distinct
-- keys to the same new key. In this case the value at the smallest of
-- these keys is retained.
-- keys to the same new key. In this case the value at the greatest of
-- the original keys is retained.
--
-- > mapKeys (+ 1) (fromList [(5,"a"), (3,"b")]) == fromList [(4, "b"), (6, "a")]
-- > mapKeys (\ _ -> 1) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")]) == singleton 1 "c"
Expand Down

0 comments on commit 820efd4

Please sign in to comment.