I have a data structure that is pretty simple (basically a structure containing some arrays and single values), but I need to record the history of the data structure so that I
You are correct. Storing the data in a purely function data structure is the way to go. Supporting anything moderately complicated using do/undo actions is reliant on the programmer being aware of all side effects of every operation, which does not scale and breaks encapsulation.