def product
import bendvy-ecs-core@0.1.0.4/restore_schema.bend as RestoreSchemaimport Base
import bendvy-ecs-core@0.1.0.4/change_tick.bend as Tick
import bendvy-ecs-core@0.1.0.4/restore_data.bend as R
import bendvy-ecs-core@0.1.0.4/restore_product.bend as Product
import bendvy-ecs-core@0.1.0.4/owner_product.bend as Owner
import bendvy-ecs-core@0.1.0.4/decode_data.bend as D
import bendvy-ecs-core@0.1.0.4/world.bend as W
64# Compose schema inventories, staged field dispatch, owner cleanup/insertion and
65# actual recovery products in left-before-right order. Canonical dispatch tries
66# right only when left is Unhandled; this adds no new duplicate-field policy.
67def product(~S:Data,~LC:Type,~LR:Type,~RC:Type,~RR:Type,~L:Type,~Right:Type,~Custom:Data,~stageLeft:L -> R.Position -> D.Field -> L & R.Dispatch<Custom>,~releaseLeft:L -> L,~clearLeft:LC -> W.Handle<S> -> LC & List<&2,R.Change<S>>,~insertLeft:LC -> LR -> L -> List<&2,R.Binding<S>> -> Tick.Tick -> (LC & LR) & L,~stageRight:Right -> R.Position -> D.Field -> Right & R.Dispatch<Custom>,~releaseRight:Right -> Right,~clearRight:RC -> W.Handle<S> -> RC & List<&2,R.Change<S>>,~insertRight:RC -> RR -> Right -> List<&2,R.Binding<S>> -> Tick.Tick -> (RC & RR) & Right,~LRecovery:Type,~RRecovery:Type,~commitLeft:L -> L,~commitRight:Right -> Right,~takeLeft:L -> L & LRecovery,~takeRight:Right -> Right & RRecovery,left:Schema<S,LC,LR,L,Custom,stageLeft,releaseLeft,clearLeft,insertLeft,LRecovery,commitLeft,takeLeft>,right:Schema<S,RC,RR,Right,Custom,stageRight,releaseRight,clearRight,insertRight,RRecovery,commitRight,takeRight>) -> Schema<S,Owner.Owner<LC,RC>,Owner.Owner<LR,RR>,Owner.Owner<L,Right>,Custom,product_stage(~S,~LC,~LR,~RC,~RR,~L,~Right,~Custom,~stageLeft,~releaseLeft,~clearLeft,~insertLeft,~stageRight,~releaseRight,~clearRight,~insertRight),Product.release(~L,~Right,~releaseLeft,~releaseRight),product_clear(~S,~LC,~RC,~clearLeft,~clearRight),product_insert(~S,~LC,~LR,~RC,~RR,~L,~Right,~Custom,~stageLeft,~releaseLeft,~clearLeft,~insertLeft,~stageRight,~releaseRight,~clearRight,~insertRight),Owner.Owner<LRecovery,RRecovery>,Product.release(~L,~Right,~commitLeft,~commitRight),Product.take_recovery(~L,~Right,~LRecovery,~RRecovery,~takeLeft,~takeRight)>:
68 match left right:
69 case Schema{left} Schema{right}:product_join(~S,~LC,~LR,~RC,~RR,~L,~Right,~Custom,~stageLeft,~releaseLeft,~clearLeft,~insertLeft,~stageRight,~releaseRight,~clearRight,~insertRight,~LRecovery,~RRecovery,~commitLeft,~commitRight,~takeLeft,~takeRight,left,right)
Uses (17)
Used by (0)
No other definition uses this definition.