orElse<F> method
Chains another result-producing operation when this result failed.
Use this for fallback reads or error recovery that can still fail.
Result<int, String> readPrimary() => const Err('cache miss');
Result<int, String> readFallback(String error) => const Ok(42);
final value = readPrimary().orElse(readFallback);
Implementation
@override
Result<T, F> orElse<F>(Result<T, F> Function(E error) next) {
return Ok<T, F>(value);
}