> Persistent data structures intrinsically involve copying on updates, and no amount of compiler cleverness can avoid that.
The compiler magic can help you there. You are looking for linear types.
The compiler magic can help you there. You are looking for linear types.
Persistent data structures intrinsically involve copying on updates, and no amount of compiler cleverness can avoid that. I can see the possibility for compiler magic with stream fusion, for example, but I'm not seeing it for data structures. The only win I can see is if you have multiple clients of your data structure holding references to multiple versions, but even there the compiler doesn't help you. Am I missing something?