traverseListSeq<E, A, B> static method

TaskEither<E, List<B>> traverseListSeq<E, A, B>(
  1. List<A> list,
  2. TaskEither<E, B> f(
    1. A a

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

Each TaskEither is executed in sequence. This strategy takes more time than parallel, but it ensures that all the request are executed in order.

If you need TaskEither to be executed in parallel, use traverseListWithIndex.

Same as TaskEither.traverseListWithIndex but without index in the map function.


static TaskEither<E, List<B>> traverseListSeq<E, A, B>(
  List<A> list,
  TaskEither<E, B> Function(A a) f,
) =>
    traverseListWithIndexSeq<E, A, B>(list, (a, _) => f(a));