Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Map.Strict.mergeWithKey strictness #1024

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions containers/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
`Data.IntSet.splitMember` are now strict in the key. Previously, the key was
ignored for an empty map or set. (Soumik Sarkar)

### Bug fixes

* `Data.Map.Strict.mergeWithKey` now forces the result of the combining function
to WHNF. (Soumik Sarkar)

## Unreleased with `@since` annotation for 0.7.1:

### Additions
Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/Map/Strict/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ mergeWithKey f g1 g2 = go
_ -> error "mergeWithKey: Given function only1 does not fulfill required conditions (see documentation)"
Just x2 -> case f kx x x2 of
Nothing -> link2 l' r'
Just x' -> link kx x' l' r'
Just !x' -> link kx x' l' r'
where
(l2, found, r2) = splitLookup kx t2
l' = go l1 l2
Expand Down