def extracted

bendvy-ecs-core@0.1.0.4 · ordinary_app_resource.bend:13

import bendvy-ecs-core@0.1.0.4/ordinary_app_resource.bend as OrdinaryAppResource
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_composer.bend as Build
import bendvy-ecs-core@0.1.0.4/ordinary_app_registration_fields.bend as Records
import bendvy-ecs-core@0.1.0.4/ordinary_app_records.bend as Leaf
import bendvy-ecs-core@0.1.0.4/ordinary_app_recipe.bend as Tree
import bendvy-ecs-core@0.1.0.4/ordinary_app_observation.bend as Leaves
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/ordinary_resource_system.bend as P
import bendvy-ecs-core@0.1.0.4/ordinary_app_resource_declaration.bend as D
import bendvy-ecs-core@0.1.0.4/ordinary_app_observation_data.bend as DTO

13# The same ordinary resource declaration drives registration, observation and metadata.
14def extracted(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Records.Fields<S>>,~Ops:Type -> Type,~Args:Type,~Error:Data,~Out:Type,~Value:Data,~declaration:D.Declaration<S,C,R,E,Ops,Value>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),~Output:Type,done:Build.Registered<S,W.World<S,C,R,E>,Owners & Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args,Error,Out,P.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~D.ordinary(~S,~C,~R,~E,~Ops,~Value,declaration),~body)>>>,DTO.Product<Rows,Value>,Tree.observe_pair(~W.World<S,C,R,E>,~Rows,~Value,~observe,~Leaves.resource_observe(~S,~C,~R,~E,~Ops,~Value,~declaration)),Leaf.fold_pair(~S,~Owners,~Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args,Error,Out,P.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~D.ordinary(~S,~C,~R,~E,~Ops,~Value,declaration),~body)>>>,~fold,~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args,Error,Out,P.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~D.ordinary(~S,~C,~R,~E,~Ops,~Value,declaration),~body)>>))> -> Output,failed:Build.Registered<S,W.World<S,C,R,E>,Owners,Rows,observe,fold> -> Output,world:W.World<S,C,R,E>,owners:Owners,debug:Bool,result:Records.Token<Sys.Registry<S,C,R,E,Args,Error,Out,P.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~D.ordinary(~S,~C,~R,~E,~Ops,~Value,declaration),~body)>> & Records.Fields<S>) -> Output:
15  match result:
16    case (token,fields):done(Build.appended(~S,~W.World<S,C,R,E>,~Owners,~Rows,~observe,~fold,~Leaf.Record<S,Records.Token<Sys.Registry<S,C,R,E,Args,Error,Out,P.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~D.ordinary(~S,~C,~R,~E,~Ops,~Value,declaration),~body)>>>,~Value,~Leaves.resource_observe(~S,~C,~R,~E,~Ops,~Value,~declaration),~Leaf.observed(~S,~Records.Token<Sys.Registry<S,C,R,E,Args,Error,Out,P.runner(~S,~C,~R,~E,~Ops,~Args,~Error,~Out,~D.ordinary(~S,~C,~R,~E,~Ops,~Value,declaration),~body)>>),world,owners,Leaf.Record{token,fields},debug))

Uses (21)

Used by (1)