Skip to content

Commit a5eaae9

Browse files
committed
Strict.differenceWithKey: Add haddocks
1 parent 1743fe8 commit a5eaae9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Data/HashMap/Internal/Strict.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,10 @@ differenceWith f = HM.differenceWithKey $
624624
x@(Just !_v) -> x
625625
{-# INLINE differenceWith #-}
626626

627+
-- | \(O(n \log m)\) Difference with a combining function. When two equal keys are
628+
-- encountered, the combining function is applied to the values of these keys.
629+
-- If it returns 'Nothing', the element is discarded (proper set difference). If
630+
-- it returns (@'Just' y@), the element is updated with a new value @y@.
627631
differenceWithKey :: Eq k => (k -> v -> w -> Maybe v) -> HashMap k v -> HashMap k w -> HashMap k v
628632
differenceWithKey f = HM.differenceWithKey $
629633
\k vA vB -> case f k vA vB of

0 commit comments

Comments
 (0)