If this is an error, applies the function to the error and returns a new Result. If this is a success, returns the value unchanged.
Example:
var r = Result.error<string,string> ("err");
var mapped = r.mapError<string> ((e) => { return e.up (); });
assert (mapped.unwrapError () == "ERR");
| func |
the error transformation function. |
|
a new Result with the transformed error. |