Add Index.indexedForA for convenience
commitea793f5ba0b902adaf036ba4279fa7d0d09ea480
authorEvan Czaplicki <evancz@users.noreply.github.com>
dateTue 14 Nov 2017, 21:35 (9 years ago)
parent4386e4d
src/Data/Index.hs+7
@@ -7,6 +7,7 @@ module Data.Index
77 , toOneBased
88 , indexedMap
99 , indexedTraverse
10+ , indexedForA
1011 , VerifiedList(..)
1112 , indexedZipWith
1213 , indexedZipWithA
@@ -69,6 +70,12 @@ indexedTraverse func list =
6970 sequenceA (indexedMap func list)
7071
7172
73+{-# INLINE indexedForA #-}
74+indexedForA :: (Applicative f) => [a] -> (ZeroBased -> a -> f b) -> f [b]
75+indexedForA list func =
76+ sequenceA (indexedMap func list)
77+
78+
7279
7380-- VERIFIED/INDEXED ZIP
7481