def pair

bendvy-ecs-core@0.1.0.4 · ordinary_app_records.bend:19

import bendvy-ecs-core@0.1.0.4/ordinary_app_records.bend as OrdinaryAppRecords
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_registration_fields.bend as Stored

19# Advanced metadata fold over heterogeneous owners in left/right order.
20# Returns both owners and appended detached fields; supplied folds must
21# preserve their owned registrations rather than fabricate authority.
22def pair(~S:Data,~Left:Type,~Right:Type,leftFold:Left -> Left & List<&2,Stored.Fields<S>>,rightFold:Right -> Right & List<&2,Stored.Fields<S>>,owners:Left & Right) -> (Left & Right) & List<&2,Stored.Fields<S>>:
23  match owners:
24    case (left,right):first(~S,~Left,~Right,rightFold,right,leftFold(left))

Uses (5)

Used by (1)