RunDSL

constructor(defaultValueOnFailure: suspend () -> A, successful: suspend (Outcome.Success<A>) -> A = { it.value }, failed: suspend (Outcome.Failure) -> A = { _ -> defaultValueOnFailure() })

Parameters

A

The type of the value produced by the computation.

defaultValueOnFailure

A suspendable function that provides the default value on failure.

successful

A function to handle successful outcomes.

failed

A function to handle failed outcomes.


constructor(defaultValueOnFailure: A)

Constructs a RunDSL with a constant default value.

Parameters

defaultValueOnFailure

The default value to use on failure.