orElse<F> method
Returns an Ok of the original value if this
is an Ok, or the result of calculateOther
otherwise.
Examples
// prints "Ok(2)"
print(const Ok<int, String>(2).orElse((_) => const Ok<int, String>(3)));
// prints "Ok(3)"
print(const Err<int, String>('error').orElse((_) => const Ok<int, String>(3)));
Implementation
@override
@useResult
Result<T, F> orElse<F>(Result<T, F> Function(E error) calculateOther) => calculateOther(error);