Skip to content

Commit af8a9b3

Browse files
committed
Add changelog and since annotations for KeyMap.insertWith
1 parent b0ea719 commit af8a9b3

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ For the latest version of this document, please see [https://github.com/haskell/
33
### 2.1.1.0
44

55
- Add `Data.Aeson.KeyMap.!?` (flipped) alias to `Data.Aeson.KeyMap.lookup`.
6+
- Add `Data.Aeson.KeyMap.insertWith` function.
67
- Use `unsafeDupablePerformIO` instead of incorrect `accursedUnutterablePerformIO` in creation of keys in TH serialisation.
78
This fixes a bug in TH deriving, e.g. when `Strict` pragma was enabled.
89

src/Data/Aeson/KeyMap.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ insert k v tm = KeyMap (M.insert k v (unKeyMap tm))
194194

195195
-- | Insert with a function combining new and old values, taken in that order.
196196
--
197+
-- @since 2.1.1.0
197198
insertWith :: (a -> a -> a) -> Key -> a -> KeyMap a -> KeyMap a
198199
insertWith f k v m = KeyMap (M.insertWith f k v (unKeyMap m))
199200

@@ -402,6 +403,7 @@ insert k v tm = KeyMap (H.insert k v (unKeyMap tm))
402403

403404
-- | Insert with a function combining new and old values, taken in that order.
404405
--
406+
-- @since 2.1.1.0
405407
insertWith :: (a -> a -> a) -> Key -> a -> KeyMap a -> KeyMap a
406408
insertWith f k v m = KeyMap (H.insertWith f k v (unKeyMap m))
407409

0 commit comments

Comments
 (0)