def index
import bendvy-ecs-core@0.1.0.4/ordinary_app_schedules.bend as OrdinaryAppSchedulesimport Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_schema.bend as App
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_observation_data.bend as DTO
import bendvy-ecs-core@0.1.0.4/world.bend as W
154# Return App and optional declared-access index. Disabled bypasses fold/index
155# derivation. Enabled folds actual owners and selects each plan's namespace/id
156# placements; this grants no execution authority and does not inspect payloads.
157def index(~S:Data,~C:Type,~R:Type,~E:Data,~H:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:H -> H & List<&2,Records.Fields<S>>,value:Application<S,C,R,E,H,Rows,observe,fold>) -> Application<S,C,R,E,H,Rows,observe,fold> & Maybe<&2,Index>:
158 match value:
159 case Application{App.Application{schema,Build.Registered{world,owners,recipe,False{}}},plans}:(Application{App.Application{schema,Build.Registered{world,owners,recipe,False{}}},plans},None{})
160 case Application{App.Application{schema,Build.Registered{world,owners,recipe,True{}}},plans}:index_named(~S,~C,~R,~E,~H,~Rows,~observe,~fold,schema,owners,recipe,plans,W.namespace(~S,~C,~R,~E,world))
Uses (14)
Used by (0)
No other definition uses this definition.