flatten

@get:JvmName(name = "flattenNestedSuccessAlias")
val <Ok, Err, Eri : Err, Ero : Err> Outcome<Outcome<Ok, Eri>, Ero>.flatten: Outcome<Ok, Err>

Property alias for flattenNestedSuccess.

Unwraps a nested Outcome from the Success state. The returned error type is the nearest common ancestor of both error types.

Parameters

Ok

The Success value type.

Err

The nearest common ancestor of Eri and Ero; the error type of the returned Outcome.

Eri

The inner (nested) Failure error type.

Ero

The outer Failure error type.

See also


@get:JvmName(name = "flattenNestedFailureAlias")
val <Ok, Err, Oki : Ok, Oko : Ok> Outcome<Oko, Outcome<Oki, Err>>.flatten: Outcome<Ok, Err>

Property alias for flattenNestedFailure.

Unwraps a nested Outcome from the Failure state. The returned value type is the nearest common ancestor of both value types.

Parameters

Ok

The nearest common ancestor of Oki and Oko; the value type of the returned Outcome.

Err

The Failure error type.

Oki

The inner (nested) Success value type.

Oko

The outer Success value type.

See also


@get:JvmName(name = "flattenNestedBothAlias")
val <Ok, Err, Oks : Ok, Ers : Err, Okf : Ok, Erf : Err> Outcome<Outcome<Oks, Ers>, Outcome<Okf, Erf>>.flatten: Outcome<Ok, Err>

Property alias for flattenNestedBoth.

Unwraps nested Outcome values from both the Success and Failure states. The returned types are the nearest common ancestors across both branches.

Parameters

Ok

The nearest common ancestor of Oks and Okf; the value type of the returned Outcome.

Err

The nearest common ancestor of Ers and Erf; the error type of the returned Outcome.

Oks

The Success value type nested inside the Success state.

Ers

The Failure error type nested inside the Success state.

Okf

The Success value type nested inside the Failure state.

Erf

The Failure error type nested inside the Failure state.

See also