MachineHandlerBundle.recover: def of bendvy-ecs-core@0.1.0.4 Import: import bendvy-ecs-core@0.1.0.4/machine_handler_bundle.bend as MachineHandlerBundle Lines 112-119 of bendvy-ecs-core@0.1.0.4/machine_handler_bundle.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.4/machine_handler_bundle.bend&start_line=112&end_line=119 import Base import world.bend as W import system.bend as Sys import machine_handlers.bend as H def recover(~S:Data,~K:Data,~V:Data,~Q:Data,~C:Type,~R:Type,~E:Data,~runner:W.World -> H.Invocation -> Sys.Outcome,String,Unit>,positions:List<&2,Position>,kept:List<&1,H.Entry>,owners:H.Owners) -> Recovery: match positions kept owners: case [] kept owners: Recovery{[],[],kept,owners} case Position{selector,needs,Kept{}} <> rest head <> tail owners: recovery_join(~S,~K,~V,~Q,~C,~R,~E,~runner,selector,needs,head,recover(~S,~K,~V,~Q,~C,~R,~E,~runner,rest,tail,owners)) case Position{selector,needs,SelectedExit{}} <> rest kept H.Owners{head <> tail,transition,enter}: recovery_join(~S,~K,~V,~Q,~C,~R,~E,~runner,selector,needs,head,recover(~S,~K,~V,~Q,~C,~R,~E,~runner,rest,kept,H.Owners{tail,transition,enter})) case Position{selector,needs,SelectedTransition{}} <> rest kept H.Owners{exit,head <> tail,enter}: recovery_join(~S,~K,~V,~Q,~C,~R,~E,~runner,selector,needs,head,recover(~S,~K,~V,~Q,~C,~R,~E,~runner,rest,kept,H.Owners{exit,tail,enter})) case Position{selector,needs,SelectedEnter{}} <> rest kept H.Owners{exit,transition,head <> tail}: recovery_join(~S,~K,~V,~Q,~C,~R,~E,~runner,selector,needs,head,recover(~S,~K,~V,~Q,~C,~R,~E,~runner,rest,kept,H.Owners{exit,transition,tail})) case positions kept owners: Recovery{[],positions,kept,owners} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/machine_handler_bundle.bend&name=Choice https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/machine_handler_bundle.bend&name=Position https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/machine_handler_bundle.bend&name=Recovery https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/machine_handler_bundle.bend&name=recovery_join https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/machine_handlers.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/machine_handlers.bend&name=Invocation https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/machine_handlers.bend&name=Owners https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/system.bend&name=Outcome https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/world.bend&name=World