def pair

bendvy-ecs-core@0.1.0.4 · ordinary_app_event_runtime.bend:52

import bendvy-ecs-core@0.1.0.4/ordinary_app_event_runtime.bend as OrdinaryAppEventRuntime
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_access.bend as Access

52# Advanced left-before-right event-owner fold composition retaining both actual
53# owners and concatenating detached access entries in order.
54def pair(~L:Type,~R:Type,~leftFold:L -> L & List<&2,Access.Entry>,~rightFold:R -> R & List<&2,Access.Entry>,events:L & R) -> (L & R) & List<&2,Access.Entry>:
55  match events:
56    case (left,right):pair_first(~L,~R,~rightFold,right,leftFold(left))

Uses (5)

Used by (6)