Skip to content

Commit 4ac960a

Browse files
authored
Expose IntMap.traverseMaybeWithKey (#743)
Closes #402.
1 parent b1f248e commit 4ac960a

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

containers/src/Data/IntMap/Internal.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,8 @@ traverseMaybeMissing f = WhenMissing
18911891

18921892

18931893
-- | /O(n)/. Traverse keys\/values and collect the 'Just' results.
1894+
--
1895+
-- @since UNRELEASED
18941896
traverseMaybeWithKey
18951897
:: Applicative f => (Key -> a -> f (Maybe b)) -> IntMap a -> f (IntMap b)
18961898
traverseMaybeWithKey f = go

containers/src/Data/IntMap/Lazy.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ module Data.IntMap.Lazy (
157157
, IM.map
158158
, mapWithKey
159159
, traverseWithKey
160+
, traverseMaybeWithKey
160161
, mapAccum
161162
, mapAccumWithKey
162163
, mapAccumRWithKey

containers/src/Data/IntMap/Strict.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ module Data.IntMap.Strict (
176176
, map
177177
, mapWithKey
178178
, traverseWithKey
179+
, traverseMaybeWithKey
179180
, mapAccum
180181
, mapAccumWithKey
181182
, mapAccumRWithKey

containers/src/Data/IntMap/Strict/Internal.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,8 @@ traverseWithKey f = go
923923
{-# INLINE traverseWithKey #-}
924924

925925
-- | /O(n)/. Traverse keys\/values and collect the 'Just' results.
926+
--
927+
-- @since UNRELEASED
926928
traverseMaybeWithKey
927929
:: Applicative f => (Key -> a -> f (Maybe b)) -> IntMap a -> f (IntMap b)
928930
traverseMaybeWithKey f = go

0 commit comments

Comments
 (0)