traverseEitherWithIndex<E, B> method

Either<E, List<B>> traverseEitherWithIndex<E, B>(
  1. Either<E, B> f(
    1. T a,
    2. int i
    )
)

Map each element in the list to an Either using the function f, and collect the result in an Either<E, List<B>>.

If any mapped element of the list is Left, then the final result will be Left.

Implementation

Either<E, List<B>> traverseEitherWithIndex<E, B>(
  Either<E, B> Function(T a, int i) f,
) =>
    Either.traverseListWithIndex(toList(), f);