map<U> method

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

Maps the value of a successful Result<T, E> from T to U, leaving an error untouched.

Implementation

Result<U, E> map<U>(U Function(T) f) =>
    isOk ? Result.ok(f(_value)) : Result.err(_error);