map<U> method
The 'map' method transforms the successful value without changing the error.
Implementation
Result<U, E> map<U>(U Function(T) f) => match(
onSuccess: (value) => Success<U, E>(f(value)),
onError: Error<U, E>.new,
);