MergeRules

The rules of a mergeRules block.

Functions

Link copied to clipboard
fun <Item> append(property: KProperty1<State, List<Item>>, write: State.(List<Item>) -> State)

The list property gets what each node added to its end, in the order of the nodes in the step. A single node may also rewrite the list. Two nodes that change it, one of which did more than add to its end, fail the run.

Link copied to clipboard
fun <Value> merge(property: KProperty1<State, Value>, combine: (current: Value, changed: List<Value>) -> Value, write: State.(Value) -> State)

property gets what combine makes of the values of the nodes that changed it:

Link copied to clipboard
fun <Value> replace(property: KProperty1<State, Value>, write: State.(Value) -> State)

property gets the value of the node that changed it. Nodes that set the same value agree. Nodes that set different values fail the run: use merge to say which one counts.