program
fun <Action, Result> program(endWith: (Result) -> Action, f: suspend ProgramBuilder<Action, Result>.() -> Result): Action
Turns the DSL provided by ProgramBuilder into an actual Action. This version is used for "pure" programs with no exceptional cases.
Parameters
end With
Reference to the "final" instruction in Action.
Throws
fun <Action, Result> program(endWith: (Result) -> Action, exceptional: (Throwable) -> Action, f: suspend ProgramBuilder<Action, Result>.() -> Result): Action
Turns the DSL provided by ProgramBuilder into an actual Action.
Parameters
end With
Reference to the "final" instruction in Action.
exceptional
Reference to the "error" instruction in Action.
fun <Action, Result, T : ProgramBuilder<Action, Result>> program(machine: T, f: suspend T.() -> Result): Action
Turns the DSL provided by a subclass T of ProgramBuilder into an actual Action.