flatten<E> static method

Maybe<E> flatten<E>(
  1. Maybe<Maybe<E>>? maybe
)

Implementation

static Maybe<E> flatten<E>(Maybe<Maybe<E>>? maybe) {
  if (maybe == null || maybe._isNothing) {
    return Maybe.nothing();
  }
  return maybe._value!;
}