mapSuccess

infix inline fun <In, Out, Error> Outcome<In, Error>.mapSuccess(transform: (In) -> Out): Outcome<Out, Error>

Transforms Outcome<In, Error> into Outcome<Out, Error> by applying transform to the Success value.

  • Failure outcomes pass through; the Error is re-wrapped to satisfy Out.

  • Unlike flatMapSuccess, transform returns a plain value — it is automatically wrapped in Success.

  • No error handling is provided.

Parameters

transform

Converts the Success value from In to Out.

See also


inline fun <In, Out, Error> OutcomeFlow<In, Error>.mapSuccess(crossinline transform: suspend (In) -> Out): OutcomeFlow<Out, Error>

Returns a new OutcomeFlow with each Success value transformed by transform. Failure outcomes pass through unaffected.

See also