def pair

bendvy-ecs-core@0.1.0.4 · ordinary_query_observable.bend:84

import bendvy-ecs-core@0.1.0.4/ordinary_query_observable.bend as OrdinaryQueryObservable
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend as N
import bendvy-ecs-core@0.1.0.4/inspector_query_projection.bend as P

84# Compose conjunctive selections from the same schema and owner types.
85# Operational grants retain (L & R), detached values Product<LV,RV>, and clause
86# order is left then right. Nest pairs for arbitrary heterogeneous shapes.
87# Example: examples/scheduled-health/registration.bend, query().
88def pair(~S:Data,~H:Type,~L:Type,~R:Type,~IH:Type,~LV:Data,~RV:Data,~left:Declaration<S,H,L,IH,LV>,~right:Declaration<S,H,R,IH,RV>) -> Declaration<S,H,L & R,IH,P.Product<LV,RV>>:
89  Declaration{_=>(N.pair(~S,~H,~L,~R,~operational(~S,~H,~L,~IH,~LV,left),~operational(~S,~H,~R,~IH,~RV,right))),_=>(P.pair(~IH,~S,~LV,~RV,~inspection(~S,~H,~L,~IH,~LV,left),~inspection(~S,~H,~R,~IH,~RV,right)))}

Uses (7)

Used by (1)