def runner

bendvy-ecs-core@0.1.0.4 · ordinary_recovery_system.bend:41

import bendvy-ecs-core@0.1.0.4/ordinary_recovery_system.bend as OrdinaryRecoverySystem
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/system.bend as Sys
import bendvy-ecs-core@0.1.0.4/transaction.bend as T
import bendvy-ecs-core@0.1.0.4/owner_product.bend as Product
import bendvy-ecs-core@0.1.0.4/ordinary_recovery_declaration.bend as D
import bendvy-ecs-core@0.1.0.4/ordinary_recoverable_array_resource.bend as F

41# Advanced recoverable runner over World/capture product and shared journal.
42# Canonical declared inverses determine commit/rollback receipts; arbitrary
43# external effects or undeclared mutations are not made reversible. Returns
44# outer Succeeded with semantic outcome and actual owners in Reply.
45def runner(~S:Data,~C:Type,~R:Type,~E:Data,~Capture:Type,~Recovery:Type,~Ops:Type -> Type,~Args:Type,~Error:Data,~Out:Type,~builder:D.Builder(~Product.Owner<W.World<S,C,R,E>,Capture>,~Recovery,~Ops),~declaration:D.Declaration<S,Product.Owner<W.World<S,C,R,E>,Capture>,Recovery,Ops,builder>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),world:W.World<S,C,R,E>,request:Request<Args,Capture>) -> Sys.Outcome<W.World<S,C,R,E>,Unit,Reply<Capture,Recovery,Error,Out>>:
46  match request:
47    case Request{args,capture}:returned(~S,~C,~R,~E,~Capture,~Recovery,~Ops,~Args,~Error,~Out,~builder,~declaration,~body,body(F.Frame<Product.Owner<W.World<S,C,R,E>,Capture>,Recovery>,D.root_grant(~S,~Product.Owner<W.World<S,C,R,E>,Capture>,~Recovery,~Ops,~builder),args,F.Frame{Product.Owner{world,capture},[]}))

Uses (14)

Used by (6)