collapse

Collapse the receiver Outcome into either value or error, using the nearest common Ancestor as the type.

Use Outcome.fold with success and failure lambda arguments to directly map each state to a specific Output type instead.

Receiver

The Outcome to collapse.

Return

The collapsed value of the nearest common Ancestor type.

Parameters

Ancestor

The nearest common ancestor type of Ok and Error.

Ok

The type of the Success value.

Error

The type of the Failure error.

See also