map<R> method
Transforms the inner success value type using the provided transform mapper callback function.
If this instance represents a failure state, the operations bypass mapping and safely forward the original failure signature downstream.
Implementation
Result<R> map<R>(R Function(T value) transform) => switch (this) {
SuccessResult<T>(success: final success) => Result<R>.success(
transform(success.value),
),
FailureResult<T>(failure: final failure) => Result<R>.failure(failure),
};