map<A, B> abstract method
Take the current Result
and transform it's values to a new Result
.
Example:
final result = ok<String, Exception>('hi');
Result<int, Error> newResult = result.map(
ok: (ok) => 1,
err: (err) => Error(),
);
Implementation
Result<A, B> map<A, B>({A Function(O ok)? ok, B Function(E err)? err});