flatten Nested Failure
fun <OuterOk : AncestorOk, EmbeddedOk : AncestorOk, Error : Any, AncestorOk : Any> Outcome<OuterOk, Outcome<EmbeddedOk, Error>>.flattenNestedFailure(): Outcome<AncestorOk, Error>
Flatten a nested Outcome inside the Outcome.Failure state, into a single Outcome.
The Ok
type of the returned Outcome will be the nearest common AncestorOk of EmbeddedOk and OuterOk.
Receiver
The Outcome.Failure of an Outcome<EmbeddedOk, Error> to flatten.
Return
The flattened Outcome<AncestorOk, Error>.
Parameters
Error
The type of the Outcome.Failure error.
Outer Ok
The type of the non-nested Outcome.Success value.
Embedded Ok
The type of the Outcome.Success value nested inside the Outcome.Failure.
Ancestor Ok
The nearest common ancestor type of EmbeddedOk and OuterOk.