map

inline fun <T, R> DataResult<T>.map(transform: (T) -> R): DataResult<R>

Applies transform to the value of a DataResult.Success, and returns a DataResult.Failure as it stands.

Return

The transformed result, or the original failure.

Parameters

transform

The transformation to apply to the carried value.