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 Success and 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
Ancestor Error
The nearest common ancestor type of SuccessError and FailureError.