3 ms·
The difference is that persistent data structures allow you to traverse the history of the data structure to find past versions. That capabilities is not a req
by j-pb 3y ago
The difference is that persistent data structures allow you to traverse the history of the data structure to find past versions.
That capabilities is not a required property of persisten datastructures.
The copy on write and collect the unique parts when a root is freed semantic that you describe is exactly the common behaviour of persistent data-structures in the wild.
Libraries like Rusts "im", even do some nifty optimisations where they combine the borrow checker with reference counting to only perform copy on write when the reference you have is non-unique.
So based on your description you build a path-copying persistent data-structure.
I'd recommend this book if you want to compare your work with the state of the art:
https://books.google.de/books/about/Purely_Functional_Data_Structures.html?id=SxPzSTcTalAC&printsec=frontcover&source=kp_read_button&hl=en&newbks=1&newbks_redir=0&gboemv=1&ovdme=1&redir_esc=y#v=onepage&q&f=false https://books.google.de/books/about/Purely_Functional_Data_S...