3 ms·
The simplest example would be a persistent list. Think you first create a list [c,d,e]. You can safely share references to that. Then you attach a to one versi
by Tarean 10y ago
The simplest example would be a persistent list. Think you first create a list [c,d,e]. You can safely share references to that. Then you attach a to one version and b to another:
a \
c-d-e
b /
The memory for the original list is still shared!
You can generalize that to trees and use that to implement, say, persistent hashmaps that can share data.
This is also awesome for parallelization where you want to share data but don't need synchronization!