traverseOptionWithIndex<B> method
Map each element in the list to an Option using the function f
,
and collect the result in an Option<List<B>>
.
If any mapped element of the list is None, then the final result will be None.
Implementation
Option<List<B>> traverseOptionWithIndex<B>(
Option<B> Function(T a, int i) f,
) =>
Option.traverseListWithIndex(toList(), f);