traverseListWithIndex<A, B> static method
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.traverseList
but passing index
in the map function.
Implementation
static IOOption<List<B>> traverseListWithIndex<A, B>(
List<A> list,
IOOption<B> Function(A a, int i) f,
) =>
IOOption<List<B>>(
() => Option.sequenceList(
IO
.traverseListWithIndex<A, Option<B>>(
list,
(a, i) => IO(() => f(a, i).run()),
)
.run(),
),
);