mapErr<F extends BaseException> method
Maps the error type when present, preserving successes.
Implementation
Result<T, F> mapErr<F extends BaseException>(F Function(E error) f) {
final self = this;
if (self is Err<T, E>) return Err<T, F>(f(self.error));
return Ok<T, F>((self as Ok<T, E>).value);
}