def root_app
import bendvy-ecs-core@0.1.0.4/ordinary_app_hierarchy.bend as OrdinaryAppHierarchyimport Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_relation.bend as Relation
import bendvy-ecs-core@0.1.0.4/ordinary_app_composer.bend as Build
import bendvy-ecs-core@0.1.0.4/ordinary_app_observation_data.bend as DTO
import bendvy-ecs-core@0.1.0.4/ordinary_app_registration_fields.bend as Fields
import bendvy-ecs-core@0.1.0.4/relation_types.bend as G
import bendvy-ecs-core@0.1.0.4/hierarchy_traversal_provider.bend as H
import bendvy-ecs-core@0.1.0.4/world.bend as W
34# Return the App and root of a valid target, including the target itself when it
35# has no parent. Invalid targets or incomplete ancestor traversal return None.
36# Reads current edges without applying queued changes.
37def root_app(~S:Data,~C:Type,~R:Type,~E:Data,~hierarchy:G.HierarchyDescriptor<S>,~Owners:Type,~Rows:Data,~prior:Relation.World(~S,~C,~R,~E) -> Relation.World(~S,~C,~R,~E) & DTO.Observation<Rows>,~fold:Owners -> Owners & List<&2,Fields.Fields<S>>,app:Application(~S,~C,~R,~E,~hierarchy,~Owners,~Rows,~prior,~fold),target:W.Handle<S>) -> Application(~S,~C,~R,~E,~hierarchy,~Owners,~Rows,~prior,~fold) & Maybe<&2,W.Handle<S>>:
38 match app:
39 case Build.Registered{world,owners,recipe,debug}:returned(~S,~C,~R,~E,~hierarchy,~Owners,~Rows,~prior,~fold,~Maybe<&2,W.Handle<S>>,owners,recipe,debug,H.lookup_root(~S,~C,~R,~E,~hierarchy,world,target))
Uses (12)
Used by (0)
No other definition uses this definition.