def undo_valid

bendvy-ecs-core@0.1.0.4 · recoverable_component_family.bend:30

import bendvy-ecs-core@0.1.0.4/recoverable_component_family.bend as RecoverableComponentFamily
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/recoverable_component.bend as RC

30# Canonical undo_column restores the saved stamp and returns the displaced
31# payload with its pre-undo stamp. Neither clocks nor unrelated owners rewind.
32def undo_valid(~S:Data,~Store:Type,~R:Type,~E:Data,~Rest:Type,~P:Type,~V:Data,~Token:Data,~take:Store -> Rest & Col.Column<S,P>,~put:Rest -> Col.Column<S,P> -> Store,~view:P -> P & V,record:RC.Record<S,P>,world:W.World<S,Store,R,E>) -> W.World<S,Store,R,E> & RC.Record<S,P>:
33  match world:
34    case W.World{ns,allocator,store,resource,events,pending,regs,sid,clock}:undone(~S,~Store,~R,~E,~Rest,~P,~V,~Token,~take,~put,~view,ns,allocator,resource,events,pending,regs,sid,clock,column_taken(~S,~Store,~R,~E,~Rest,~P,~V,~Token,~take,~put,~view,record,take(store)))

Uses (6)

Used by (1)