def add_undo
import bendvy-ecs-core@0.1.0.4/transaction.bend as Transactionimport Base
30# Trusted lower-level operation: push an affine inverse onto the journal.
31# Caller must ensure it restores the matching change and preserves other
32# owners. Inverses execute newest first on failure, not on successful commit.
33def add_undo(~W: Type, ~E: Data, tx: Tx<W, E>, inverse: W -> W) -> Tx<W, E>:
34 match tx:
35 case Tx{world, undo, commands, events,trace}:
36 Tx{world, inverse <> undo, commands, events,trace}
Uses (2)
Used by (0)
No other definition uses this definition.