Skip to content

Commit d0dcc17

Browse files
committed
Fix strictness bug in fromListWith
`Strict.fromListWith` was sometimes insufficiently value-strict in case of collisions. The spine-strictness of `map`, used in the `fromListWith` strictness test, was hiding the problem.
1 parent cea2f74 commit d0dcc17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Data/HashMap/Base.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ infixl 9 !
634634

635635
-- | Create a 'Collision' value with two 'Leaf' values.
636636
collision :: Hash -> Leaf k v -> Leaf k v -> HashMap k v
637-
collision h e1 e2 =
637+
collision h !e1 !e2 =
638638
let v = A.run $ do mary <- A.new 2 e1
639639
A.write mary 1 e2
640640
return mary

0 commit comments

Comments
 (0)