andThen<U> method

Maybe<U>? andThen<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> andThen<U>(Maybe<U> f(T val)) {
  if (this != null) return f(this!.value);
  return None();
}