I would like to find an immutable/persistent data structure that allows efficient updating for 2d (or higher) lattices/arrays/matrices, and reasonable performance when appending in any direction. Updates would be typically be localized to certain areas.
I could probably make do with mapping a 1d vector onto 2 dimensions, but is there something better?
Background: I would like to implement a kind of cellular automaton where history is preserved to a degree.