fold
inline fun <Ok : Any, Error : Any, Output> Outcome<Ok, Error>.fold(failure: Failure<Error>.() -> Output, success: Success<Ok>.() -> Output): Output
Fold
the caller into some Output.
If Output is Outcome,
fold
can be used toflatMap
both outcomes.Use collapse to assume the nearest common
Ancestor
as the Output type.
Receiver
The Outcome to collapse.
Return
The collapsed value of type Output.
Parameters
See also
collapse