traverseOption<B> method

Option<List<B>> traverseOption<B>(
  1. Option<B> f(
    1. T a
    )
)

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>> traverseOption<B>(
  Option<B> Function(T a) f,
) =>
    Option.traverseList(toList(), f);