def machine_write
import bendvy-ecs-core@0.1.0.4/ordinary_app_resource_field_declaration.bend as OrdinaryAppResourceFieldDeclarationimport Base
import bendvy-ecs-core@0.1.0.4/machine.bend as Machine
import bendvy-ecs-core@0.1.0.4/ordinary_machine_declaration.bend as MachineDecl
import bendvy-ecs-core@0.1.0.4/ordinary_machine_operations.bend as MachineOps
import bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend as Query
import bendvy-ecs-core@0.1.0.4/ordinary_resource_field_system.bend as Field
106# Build a resource-style App declaration for one declared state machine.
107# The same machine supplies the access key, current-value observer and queued
108# write operation. take/put select its Slot and same compares values. The grant
109# submits QueueInput through ordinary-machine-operations; constructing or reading
110# this declaration does not apply a queued transition. See
111# ordinary-machine-declaration and ordinary-machine-operations for that boundary.
112def machine_write(~S:Data,~K:Data,~V:Data,~C:Type,~R:Type,~E:Data,~take:R -> R & Machine.Slot<S,K,V>,~put:R -> Machine.Slot<S,K,V> -> R,~same:V -> V -> Bool,~machine:MachineDecl.Declaration<S,K,V,R,take>,~render:V -> String) -> Declaration<S,C,R,E,machine_ops(~S,~K,~V),Machine.CurrentView<S,K,V>>:
113 Declaration{Field.Declaration{MachineOps.write(~S,~K,~V,~C,~R,~E,~take,~put,~same,~machine),[Query.Clause{MachineDecl.name(~S,~K,~V,~R,~take,machine),Query.Write{}}]},machine_observe(~S,~K,~V,~C,~R,~E,~take,~machine),machine_render(~S,~K,~V,~render)}
Uses (16)
Used by (0)
No other definition uses this definition.