def runner

bendvy-ecs-core@0.1.0.4 · ordinary_capture_query.bend:20

import bendvy-ecs-core@0.1.0.4/ordinary_capture_query.bend as OrdinaryCaptureQuery
import Base
import bendvy-ecs-core@0.1.0.4/change_tick.bend as Tick
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/compose.bend as Q
import bendvy-ecs-core@0.1.0.4/capture_query.bend as Fold
import bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend as Decl
import bendvy-ecs-core@0.1.0.4/local.bend as Local
import bendvy-ecs-core@0.1.0.4/transaction.bend as T

20# Advanced captured-query runner with explicit (args,cursor). Threads L
21# through selected rows while the ECS transaction journals World changes.
22# Failure retains returned capture but discards row outputs. Bypasses runtime
23# registration checks; ordinary callers use define/run or App capture add.
24def runner(~S:Data,~C:Type,~R:Type,~E:Data,~L:Type,~Ops:Type -> Type,~A:Data,~U:Data,~Out:Data,~query:Decl.Declaration<S,Q.Frame<S,C,R,E>,Ops(Q.Frame<S,C,R,E>)>,~body:@-H:Type -> @-caps:Ops(H) -> L -> A -> H -> H & (L & (T.Outcome<U> & Out)),world:W.World<S,C,R,E>,capture:L,args:A & Maybe<&2,Tick.Tick>) -> Local.Outcome<W.World<S,C,R,E>,L,Q.Error<U>,List<&2,Out>>:
25  match args:
26    case (args,cursor):finished(~S,~C,~R,~E,~L,~U,~Out,Fold.each_since(~S,~C,~R,~E,~L,~U,~Out,~Ops,~A,~plan(~S,~C,~R,~E,~L,~Ops,~A,~U,~Out,~query,~body),~body,args,cursor,capture,world))

Uses (14)

Used by (7)