orElse method

Option<T> orElse(
  1. Option<T> op()
)
inherited

Returns the option if it contains a value, otherwise calls op and returns the result.

Implementation

Option<T> orElse(Option<T> Function() op) {
  return isSome() ? this as Some<T> : op();
}