flatten Nested Both
fun <SuccessOk : AncestorOk, SuccessError : AncestorError, FailureOk : AncestorOk, FailureError : AncestorError, AncestorOk : Any, AncestorError : Any> Outcome<Outcome<SuccessOk, SuccessError>, Outcome<FailureOk, FailureError>>.flattenNestedBoth(): Outcome<AncestorOk, AncestorError>
Flatten the nested Outcome inside both Outcome.Success and Outcome.Failure states, into a single Outcome.
The Ok
and Error
types of the returned Outcome will be the nearest common AncestorOk and AncestorError.
Receiver
The Outcome to flatten, with a nested Outcome inside both success and failure states.
Return
The flattened Outcome<AncestorOk, AncestorError>.
Parameters
Success Ok
The type of the Outcome.Success value nested inside the Outcome.Success.
Success Error
The type of the Outcome.Failure error nested inside the Outcome.Success.
Failure Ok
The type of the Outcome.Success value nested inside the Outcome.Failure.
Failure Error
The type of the Outcome.Failure error nested inside the Outcome.Failure.
Ancestor Error
The nearest common ancestor type of SuccessError and FailureError.