def attach_conditions

bendvy-ecs-core@0.1.0.4 · ordinary_app_schedule.bend:122

import bendvy-ecs-core@0.1.0.4/ordinary_app_schedule.bend as OrdinaryAppSchedule
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_condition_composition.bend as Comp
import ordinary_app_schema.bend as App
import ordinary_app_composer.bend as Build
import ordinary_app_registration_fields.bend as Records
import ordinary_app_observation_data.bend as DTO
import world.bend as W
import schedule.bend as Sch

122# Attach typed condition owners by actual scheduled system ID. Duplicate
123# bindings and targets absent from the schedule refuse attachment; refusal
124# returns both App and bindings. Does not evaluate guards or run system bodies.
125# A scheduled system with no binding is unconditional, not implicitly skipped.
126def attach_conditions(~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>>,~B:Type,~select:B -> W.World<S,C,R,E> -> U32 -> Comp.Evaluation<W.World<S,C,R,E>,B>,value:Application<S,C,R,E,H,Rows,observe,fold>,bindings:Comp.Bindings<W.World<S,C,R,E>,B,select>) -> ConditionAttachment<Application<S,C,R,E,H,Rows,observe,fold>,Comp.Bindings<W.World<S,C,R,E>,B,select>,ConditionedApplication<S,C,R,E,H,Rows,observe,fold,B,select>>:
127  match value:
128    case Application{App.Application{schema,Build.Registered{world,owners,recipe,debug}},plan,namespace,name,steps,needs}:conditions_attached(~S,~C,~R,~E,~H,~Rows,~observe,~fold,~B,~select,schema,world,recipe,debug,plan,needs,Comp.attach(~S,~C,~R,~E,~H,~B,~select,Sch.Schedule{namespace,name,steps,owners},bindings))

Uses (16)

Used by (0)

No other definition uses this definition.