Maps the error inside Err if it exists, keeping Ok unchanged.
Result<T, F> mapErr<F>(F Function(E error) fn) { if (this is Err<T, E>) { return Err(fn((this as Err<T, E>).error)); } return this as Result<T, F>; }