Package-level declarations

The core ProgramBuilder and corresponding runner. Every DSL generated by the plug-in is based on these two.

Types

Link copied to clipboard
open class ProgramBuilder<Action, Result>(endWith: (Result) -> Action, exceptional: (Throwable) -> Action = { e -> throw e })

This class provides a DSL to build initial-style programs, given the type of basic actions or instructions.

Functions

Link copied to clipboard
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.

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.

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.