3 ms·
Purely functional data structures are very common in purely functional languages like Haskell but are also used in non functional languages via libraries like i
by thethimble 3y ago
Purely functional data structures are very common in purely functional languages like Haskell but are also used in non functional languages via libraries like immutable.js.
At a high level, immutability forces you to be extremely deliberate about state changes in your application. This improves reasoning/understanding, reduces bugs, and eases debugging.
An example of immutability that you might be familiar with would be react props/state. You don’t modify your state. This makes reasoning about state much more simple.