andThen<U> method
Chains another computation only when this result is successful.
Implementation
Result<U, E> andThen<U>(Result<U, E> Function(T value) next) {
final self = this;
if (self is Ok<T, E>) return next(self.value);
return Err<U, E>((self as Err<T, E>).error);
}