def both

bendvy-ecs-core@0.1.0.4 · ordinary_recovery_declaration.bend:55

import bendvy-ecs-core@0.1.0.4/ordinary_recovery_declaration.bend as OrdinaryRecoveryDeclaration
import Base
import bendvy-ecs-core@0.1.0.4/recovery_use.bend as Use
import bendvy-ecs-core@0.1.0.4/owner_product.bend as Product
import bendvy-ecs-core@0.1.0.4/capabilities.bend as Cap

55# Compose two closed declarations for the same schema and State.
56# The body receives Cap.Bundle{left, right}; recovery owners form
57# Product.Owner<LeftRecovery, RightRecovery>. Access entries and typed use lists
58# are appended left first, preserving duplicates; opacity in either description
59# remains opaque. This does not execute either operation or create two journals.
60# The recovery runner uses one shared LIFO journal across both grants: commit
61# returns displaced originals, rollback restores recorded state and returns
62# replacements. Effects outside the declared operations are not made reversible.
63# Canonical leaves: ordinary-recovery-component.declaration,
64# ordinary-recovery-resource.declaration and ordinary-recovery-capture.declaration;
65# ordinary-recovery-system registers/runs the resulting declaration.
66def both(~S:Data,~State:Type,~L:Type,~R:Type,~LOps:Type -> Type,~ROps:Type -> Type,~leftBuilder:Builder(~State,~L,~LOps),~rightBuilder:Builder(~State,~R,~ROps),~left:Declaration<S,State,L,LOps,leftBuilder>,~right:Declaration<S,State,R,ROps,rightBuilder>) -> Declaration<S,State,Product.Owner<L,R>,PairOps(~LOps,~ROps),pair_grant(~S,~State,~L,~R,~LOps,~ROps,~leftBuilder,~rightBuilder)>:
67  Described{pair_empty(~L,~R,~empty(~S,~State,~L,~LOps,~leftBuilder,left),~empty(~S,~State,~R,~ROps,~rightBuilder,right)),List.append(&2,String,access(~S,~State,~L,~LOps,~leftBuilder,left),access(~S,~State,~R,~ROps,~rightBuilder,right)),Use.pair(description(~S,~State,~L,~LOps,~leftBuilder,left),description(~S,~State,~R,~ROps,~rightBuilder,right))}

Uses (12)

Used by (0)

No other definition uses this definition.