or<F> method
Returns this result when it succeeded, or other otherwise.
other is evaluated before the call. Use orElse when the fallback
needs the error or is expensive to build.
final value = const Err<int, String>('cache miss')
.or(const Ok<int, String>(42)); // Ok(42)
Implementation
Result<T, F> or<F>(Result<T, F> other) {
return switch (this) {
Ok<T, E>(:final value) => Ok<T, F>(value),
Err<T, E>() => other,
};
}