News for hackers. Stuff that matters.
Re:Purely Functional Data Structure by Chris Okasaki [pdf] by thethimble on Tuesday May 30, 2023 @10:47AM (#36125503)
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.

There are no comments on this comment yet.