fold

inline fun <Ok, Error, Output> Outcome<Ok, Error>.fold(failure: Failure<Error>.() -> Output, success: Success<Ok>.() -> Output): Output

Applies success or failure to the receiver Outcome, returning Output.

Parameters

success

Lambda applied when the receiver is a Success.

failure

Lambda applied when the receiver is a Failure.

See also