def selected_write

bendvy-ecs-core@0.1.0.3 · execution_machine_access.bend:42

import bendvy-ecs-core@0.1.0.3/execution_machine_access.bend as ExecutionMachineAccess
import Base
import bendvy-ecs-core@0.1.0.3/execution_machine_state.bend as State
import bendvy-ecs-core@0.1.0.3/execution_access.bend as A
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout

42# These selection helpers consume the existing Builder callbacks. They return no
43# raw cell writer and keep capability+conflict metadata in the same closed Program.
44def selected_write(-S:Data,-K:Data,-V:Data,-H:Type,-B:Type,-layout:Layout.Layout,-route:Layout.Route,payload:{Layout.payload(layout,route) == State.Cell<S,K,V> : Type},view:{Layout.view(layout,route) == State.View<S,K,V> : Data},same:V -> V -> Bool,result:B & A.ResourceWrite<H,Layout.payload(layout,route),Layout.view(layout,route)>) -> B & Write<S,K,V,H>:
45  match result:
46    case (book,cap):(book,write(S,K,V,H,same,checked_write(S,K,V,H,(Layout.payload(layout,route)),(Layout.view(layout,route)),payload,view,cap)))

Uses (13)

Used by (1)