def despawn
import bendvy-ecs-core@0.1.0.4/compose.bend as Composeimport Base
import world.bend as W
import commands.bend as Cmd
119# Advanced row operation staging schema-owned cleanup of the current handle.
120# Admission refusal records the first Frame error. Accepted staging is not visible
121# until successful finish and an explicit barrier; clear is trusted schema setup.
122def despawn(~S: Data,~Store: Type,~R: Type,~E: Data,~clear: Store -> W.Handle<S> -> Store,frame: Frame<S,Store,R,E>) -> Frame<S,Store,R,E>:
123 match frame:
124 case Frame{tx,+handle,error,cursor}: despawn_join(~S,~Store,~R,~E,handle,error,cursor,Cmd.tx_despawn_with(~S,~Store,~R,~E,~clear,tx,handle))