Closed paulgb closed 2 years ago
The more I think about it, the more I think transactions are the wrong approach. The need for transactions implies that a user intent could result in multiple state transitions, but the correct way to model that is for the user intent to represent one state transition that captures both actions.
For built-in data structures, it might sometimes be useful to be able to atomically perform multiple operations. I'd need to give some thought to the best way to do this, but one idea is to have a
Transactioned
pseudo-data structure that wraps a state machine and accepts aTransaction
update. Something like (not tested):