traverseList<A, B> static method

IO<List<B>> traverseList<A, B>(
  1. List<A> list,
  2. IO<B> f(
    1. A a
    )
)

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

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

Implementation

static IO<List<B>> traverseList<A, B>(
  List<A> list,
  IO<B> Function(A a) f,
) =>
    traverseListWithIndex<A, B>(list, (a, _) => f(a));