flatMap<U> method

Maybe<U>? flatMap<U>(
  1. Maybe<U>? f(
    1. T val
    )
)

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

Implementation

Maybe<U> flatMap<U>(Maybe<U> f(T val)) {
  if (this != null) return f(this!.value);
  return None();
}