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

endWith

Reference to the "final" instruction in Action.

Throws

If an exception is raised during the execution of f, it will be propagated.


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

endWith

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.