If this is a success, applies the function to the value and returns a new Result. If this is an error, returns the error unchanged.
Example:
var r = Result.ok<string,string> ("hello");
var mapped = r.map<string> ((s) => { return s.up (); });
assert (mapped.unwrap () == "HELLO");
| func |
the transformation function. |
|
a new Result with the transformed value. |