4 ms·
The big win is they enable lazy evaluation: you can defer the evaluation of an expression until it's needed, or discard the result and compute it again later, o
by couchand 12y ago
The big win is they enable lazy evaluation: you can defer the evaluation of an expression until it's needed, or discard the result and compute it again later, or cache the result of an expression and not need to re-evaluate, a flexibility which can be useful in many situations.
You also get undo/redo stacks basically for free, since you simply maintain references to the previous n immutable states.
As Om demonstrates, they also make possible significant optimizations of code that takes various view of the same underlying data, like rendering routines.