andThen<U extends Object> method

Option<U> andThen<U extends Object>(
  1. Option<U> f(
    1. T
    )
)

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 extends Object>(Option<U> Function(T) f) {
  return v == null ? None : f(v!);
}