import Base import ./captures.bend as Captures import ./local.bend as Local import ./ordinary_app_local_fields.bend as Ord import ./ordinary_resource_system.bend as P import ./world.bend as W import ./transaction.bend as T # Ordinary authored body receives declared capabilities and its runtime capture. # Registration metadata and transaction completion derive from the declaration. def define(~S:Data,~C:Type,~R:Type,~E:Data,~L:Type,~Args:Type,~Error:Data,~Out:Type,~Ops:Type -> Type,~declaration:P.Declaration,E>,Ops(T.Tx,E>)>,~body:@-H:Type -> @-caps:Ops(H) -> L -> Args -> H -> H & (L & (T.Outcome & Out)),world:W.World,name:String,local:L) -> Local.Registered: Captures.register(~S,~C,~R,~E,~L,~Args,~Error,~Out,~Ord.runner(~S,~C,~R,~E,~L,~Args,~Error,~Out,~Ops,~declaration,~body),world,name,P.access(~S,P.clause(~S,~R,~T.Tx,E>,~Ops(T.Tx,E>),declaration)),local)