Outcome
The result of an operation.
To store progress information as well as the result of the operation, please see ProgressiveOutcome.
There are two possible cases:
Success if a successful result is available (see Success.value),
Failure if a failed result is available (see Failure.failure).
To create outcomes from computations, use the successful and failed factories.
Arrow
Outcome is essentially identical to Arrow's Either. When using Arrow, we recommend using Either most of the time because of all the convenience functions and DSLs it has. Using our companion library state-arrow
, it is possible to use Outcome in the Raise DSL.
Because of this, we will keep Outcome as simple as possible, and avoid adding too much sugar.
Inheritors
Properties
Returns Failure.failure, or null
if this outcome is not a failure.
Returns Success.value, or null
if this outcome is not successful.
Functions
If this outcome is successful, replaces its value using transform.
If this outcome is failed, replaces its failure using transformFailure.
Adds progress information to this outcome to make it a ProgressiveOutcome.