map<U> method

Result<U, E> map<U>(
  1. U f(
    1. T
    )
)

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,
    );