Skip to content

Commit 3684e7c

Browse files
committed
Clarify strict versions using seq
1 parent a5eaae9 commit 3684e7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Data/HashMap/Internal/Strict.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ differenceWith :: (Eq k, Hashable k) => (v -> w -> Maybe v) -> HashMap k v -> Ha
621621
differenceWith f = HM.differenceWithKey $
622622
\_k vA vB -> case f vA vB of
623623
Nothing -> Nothing
624-
x@(Just !_v) -> x
624+
x@(Just v) -> v `seq` x
625625
{-# INLINE differenceWith #-}
626626

627627
-- | \(O(n \log m)\) Difference with a combining function. When two equal keys are
@@ -632,7 +632,7 @@ differenceWithKey :: Eq k => (k -> v -> w -> Maybe v) -> HashMap k v -> HashMap
632632
differenceWithKey f = HM.differenceWithKey $
633633
\k vA vB -> case f k vA vB of
634634
Nothing -> Nothing
635-
x@(Just !_v) -> x
635+
x@(Just v) -> v `seq` x
636636
{-# INLINE differenceWithKey #-}
637637

638638
-- | \(O(n+m)\) Intersection of two maps. If a key occurs in both maps

0 commit comments

Comments
 (0)