isOkAnd method
Whether the result succeeded and its value satisfies predicate.
predicate is not called for an Err.
final passed = const Ok<int, String>(90).isOkAnd((score) => score >= 50);
Implementation
bool isOkAnd(bool Function(T value) predicate) {
return switch (this) {
Ok<T, E>(:final value) => predicate(value),
Err<T, E>() => false,
};
}