def inverse
bendvy-ecs-core@0.1.0.4 · ordinary_recovery_component.bend:24
import bendvy-ecs-core@0.1.0.4/ordinary_recovery_component.bend as OrdinaryRecoveryComponent
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/column.bend as Col
import bendvy-ecs-core@0.1.0.4/owner_product.bend as Product
import bendvy-ecs-core@0.1.0.4/ordinary_component_binding.bend as B
import bendvy-ecs-core@0.1.0.4/recoverable_component.bend as RC
import bendvy-ecs-core@0.1.0.4/recoverable_component_family.bend as Family
import bendvy-ecs-core@0.1.0.4/recoverable_owner.bend as RO
24def inverse(~S:Data,~C:Type,~R:Type,~E:Data,~Capture:Type,~Rest:Type,~P:Type,~V:Data,~Token:Data,~take:C -> Rest & Col.Column<S,P>,~put:Rest -> Col.Column<S,P> -> C,~view:P -> P & V,~binding:B.Binding<S,C,Rest,P,V,Token,take,put,view>,~All:Type,~ReleasedRest:Type,~path:Product.Lens<All,List<RC.Record<S,P>>,ReleasedRest>,old:RC.Record<S,P>,success:Bool,state:Product.Owner<W.World<S,C,R,E>,Capture>,recovery:All) -> Product.Owner<W.World<S,C,R,E>,Capture> & All:
25 match success state:
26 case True{} state:(state,RO.append(~All,~RC.Record<S,P>,~ReleasedRest,~path,recovery,old))
27 case False{} Product.Owner{world,capture}:released(~S,~C,~R,~E,~Capture,~Rest,~P,~V,~Token,~take,~put,~view,~binding,~All,~ReleasedRest,~path,capture,recovery,Family.undo(~S,~C,~R,~E,~Rest,~P,~V,~Token,~take,~put,~view,~B.family(~S,~C,~Rest,~P,~V,~Token,~take,~put,~view,binding),old,world))