orElse method

Option<T> orElse(
  1. Option<T> alternative()
)

Returns Option if Some, or None otherwise.

Implementation

Option<T> orElse(Option<T> Function() alternative) {
  if (this is Some<T>) {
    return this;
  }
  return alternative();
}