def attach

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

import bendvy-ecs-core@0.1.0.4/ordinary_app_schedule.bend as OrdinaryAppSchedule
import Base
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_provision.bend as SP

60# Attach an explicit operational plan to an application, validating steps
61# against its current registration catalog. Returns Attached or Invalid with
62# the original owner. Does not execute bodies or flush pending commands.
63# Prefer ordinary-app-run.attach for a plan derived from registrations.
64def attach(~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>>,app:App.Application<S,C,R,E,H,Rows,observe,fold>,name:String,plan:SP.Plan<S>) -> Attachment<App.Application<S,C,R,E,H,Rows,observe,fold>,Application<S,C,R,E,H,Rows,observe,fold>>:
65  match app:
66    case App.Application{schema,Build.Registered{world,owners,recipe,debug}}:cataloged(~S,~C,~R,~E,~H,~Rows,~observe,~fold,schema,owners,recipe,debug,plan,name,catalog(~S,~C,~R,~E,world))

Uses (13)

Used by (5)