traverseListWithIndex<E, A, B> static method
Map each element in the list to a IOEither using the function f
,
and collect the result in an IOEither<E, List<B>>
.
Same as IOEither.traverseList
but passing index
in the map function.
Implementation
static IOEither<E, List<B>> traverseListWithIndex<E, A, B>(
List<A> list,
IOEither<E, B> Function(A a, int i) f,
) =>
IOEither<E, List<B>>(
() => Either.sequenceList(
IO
.traverseListWithIndex<A, Either<E, B>>(
list,
(a, i) => IO(() => f(a, i).run()),
)
.run(),
),
);