map<R> method

Result<R> map<R>(
  1. R transform(
    1. T value
    )
)

Applies transform to the value of an Ok, passing an Err through untouched.

Implementation

Result<R> map<R>(R Function(T value) transform) => switch (this) {
      Ok(:final value) => Ok<R>(transform(value)),
      Err(:final failure) => Err<R>(failure),
    };