def apply_checked
bendvy-ecs-core@0.1.0.4 · bundle_delivery.bend:12
import bendvy-ecs-core@0.1.0.4/bundle_delivery.bend as BundleDelivery
import Base
import world.bend as W
12def apply_checked(~S:Data,~Store:Type,~R:Type,~E:Data,~P:Type,~attempt:W.World<S,Store,R,E> -> W.Handle<S> -> P -> Delivery<W.World<S,Store,R,E>,P>,~recover:W.World<S,Store,R,E> -> P -> W.WorldError -> W.World<S,Store,R,E>,observed:W.World<S,Store,R,E> & Bool,handle:W.Handle<S>,payload:P) -> W.World<S,Store,R,E>:
13 match observed:
14 case (world,False{}): recover(world,payload,W.MissingEntity{})
15 case (world,True{}): deliver(~W.World<S,Store,R,E>,~P,~recover,attempt(world,handle,payload))