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