Run DSL
class RunDSL<A>(defaultValueOnFailure: suspend () -> A, successful: suspend (Outcome.Success<A>) -> A = { it.value }, failed: suspend (Outcome.Failure) -> A = { _ -> defaultValueOnFailure() })
A DSL for configuring the behavior of run and runSync methods.
Parameters
A
The type of the value produced by the computation.
default Value On Failure
A suspendable function that provides the default value on failure.
successful
A function to handle successful outcomes.
failed
A function to handle failed outcomes.
Constructors
Link copied to clipboard
constructor(defaultValueOnFailure: suspend () -> A, successful: suspend (Outcome.Success<A>) -> A = { it.value }, failed: suspend (Outcome.Failure) -> A = { _ -> defaultValueOnFailure() })
Constructs a RunDSL with a constant default value.
Functions
Link copied to clipboard
Builds the configuration into a pair of success and failure handlers.
Link copied to clipboard
Sets the default value provider for failed computations.
Link copied to clipboard
Configures the handling of failed outcomes.
Link copied to clipboard
Configures the handling of successful outcomes.