andThen<U> method

Option<U> andThen<U>(
  1. Option<U> f(
    1. T value
    )
)

Returns None if the option is None, otherwise calls f with the wrapped value and returns the result.

Some languages call this operation flatmap.

Implementation

Option<U> andThen<U>(Option<U> Function(T value) f) =>
    isSome ? f(_someValue) : None<U>();