traverseList<A, B> static method

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

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

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

Implementation

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