Skip to content
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
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for patch

## 0.0.8.5

* Strict `apply` for `PatchIntMap`, bringing it in line with the other `Map` types.

## 0.0.8.4

* Support for GHC 9.12
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Patch/IntMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ makeWrapped ''PatchIntMap
-- | Apply the insertions or deletions to a given 'IntMap'.
instance Patch (PatchIntMap a) where
type PatchTarget (PatchIntMap a) = IntMap a
apply (PatchIntMap p) v = if IntMap.null p then Nothing else Just $
apply (PatchIntMap p) v = if IntMap.null p then Nothing else Just $!
let removes = IntMap.filter isNothing p
adds = IntMap.mapMaybe id p
in IntMap.union adds $ v `IntMap.difference` removes
Expand Down
Loading