Skip to content

Commit b97186e

Browse files
committed
Resolve #943: Export KeyMap.mapWithKey
1 parent 27495b0 commit b97186e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ For the latest version of this document, please see [https://github.com/haskell/
44

55
- Change time instances of types with year (`Day`, `UTCTime`) to require years with at least 4 digits.
66
- Change `KeyValue` instances to be more general (and use equality to constraint them) instead of being more lax flexible instances.
7-
- Export `Key` type also from `Data.Aeson.KeyMap` module
7+
- Export `Key` type also from `Data.Aeson.KeyMap` module.
8+
- Export `mapWithKey` from `Data.Aeson.KeyMap` module.
89

910
### 2.0.3.0
1011

src/Data/Aeson/KeyMap.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ module Data.Aeson.KeyMap (
6565
-- * Traversal
6666
-- ** Map
6767
map,
68+
mapWithKey,
6869
mapKeyVal,
6970
traverse,
7071
traverseWithKey,
@@ -194,6 +195,8 @@ map :: (a -> b) -> KeyMap a -> KeyMap b
194195
map = fmap
195196

196197
-- | Map a function over all values in the map.
198+
--
199+
-- @since 2.1.0.0
197200
mapWithKey :: (Key -> a -> b) -> KeyMap a -> KeyMap b
198201
mapWithKey f (KeyMap m) = KeyMap (M.mapWithKey f m)
199202

@@ -395,6 +398,8 @@ map :: (a -> b) -> KeyMap a -> KeyMap b
395398
map = fmap
396399

397400
-- | Map a function over all values in the map.
401+
--
402+
-- @since 2.1.0.0
398403
mapWithKey :: (Key -> a -> b) -> KeyMap a -> KeyMap b
399404
mapWithKey f (KeyMap m) = KeyMap (H.mapWithKey f m)
400405

0 commit comments

Comments
 (0)