We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1743fe8 commit a5eaae9Copy full SHA for a5eaae9
Data/HashMap/Internal/Strict.hs
@@ -624,6 +624,10 @@ differenceWith f = HM.differenceWithKey $
624
x@(Just !_v) -> x
625
{-# INLINE differenceWith #-}
626
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@.
631
differenceWithKey :: Eq k => (k -> v -> w -> Maybe v) -> HashMap k v -> HashMap k w -> HashMap k v
632
differenceWithKey f = HM.differenceWithKey $
633
\k vA vB -> case f k vA vB of
0 commit comments