Skip to content

Commit f072271

Browse files
authored
Merge pull request #247 from Dretch/fix-update-docs
Fix inaccurate and badly formatted docs for update
2 parents 1757e89 + 37b3b80 commit f072271

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Data/HashMap/Base.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,9 @@ adjust# f k0 m0 = go h0 k0 0 m0
11691169
| otherwise = t
11701170
{-# INLINABLE adjust# #-}
11711171

1172-
-- | /O(log n)/ The expression (@'update' f k map@) updates the value @x@ at @k@,
1173-
-- (if it is in the map). If (f k x) is @'Nothing', the element is deleted.
1174-
-- If it is (@'Just' y), the key k is bound to the new value y.
1172+
-- | /O(log n)/ The expression @('update' f k map)@ updates the value @x@ at @k@
1173+
-- (if it is in the map). If @(f x)@ is 'Nothing', the element is deleted.
1174+
-- If it is @('Just' y)@, the key @k@ is bound to the new value @y@.
11751175
update :: (Eq k, Hashable k) => (a -> Maybe a) -> k -> HashMap k a -> HashMap k a
11761176
update f = alter (>>= f)
11771177
{-# INLINABLE update #-}

Data/HashMap/Strict/Base.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ adjust f k0 m0 = go h0 k0 0 m0
251251
| otherwise = t
252252
{-# INLINABLE adjust #-}
253253

254-
-- | /O(log n)/ The expression (@'update' f k map@) updates the value @x@ at @k@,
255-
-- (if it is in the map). If (f k x) is @'Nothing', the element is deleted.
256-
-- If it is (@'Just' y), the key k is bound to the new value y.
254+
-- | /O(log n)/ The expression @('update' f k map)@ updates the value @x@ at @k@
255+
-- (if it is in the map). If @(f x)@ is 'Nothing', the element is deleted.
256+
-- If it is @('Just' y)@, the key @k@ is bound to the new value @y@.
257257
update :: (Eq k, Hashable k) => (a -> Maybe a) -> k -> HashMap k a -> HashMap k a
258258
update f = alter (>>= f)
259259
{-# INLINABLE update #-}

0 commit comments

Comments
 (0)