File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ module Data.FoldableWithIndex
1010 , surroundMapWithIndex
1111 , allWithIndex
1212 , anyWithIndex
13- , ValueWithIndex
1413 , findWithIndex
1514 ) where
1615
@@ -260,19 +259,20 @@ anyWithIndex
260259 -> b
261260anyWithIndex t = unwrap <<< foldMapWithIndex (\i -> Disj <<< t i)
262261
263- -- | Isomorphic to `Tuple i a`.
264- type ValueWithIndex i a = { index :: i , value :: a }
265-
266262-- | Try to find an element in a data structure which satisfies a predicate
267263-- | with access to the index.
268264findWithIndex
269265 :: forall i a f
270266 . FoldableWithIndex i f
271267 => (i -> a -> Boolean )
272268 -> f a
273- -> Maybe ( ValueWithIndex i a )
269+ -> Maybe { index :: i , value :: a }
274270findWithIndex p = foldlWithIndex go Nothing
275271 where
276- go :: i -> Maybe (ValueWithIndex i a ) -> a -> Maybe (ValueWithIndex i a )
272+ go
273+ :: i
274+ -> Maybe { index :: i , value :: a }
275+ -> a
276+ -> Maybe { index :: i , value :: a }
277277 go i Nothing x | p i x = Just { index: i, value: x}
278278 go _ r _ = r
You can’t perform that action at this time.
0 commit comments