Immutability, dereferencing, and complex data structures

It’s interesting… The more I think about all the cases where people highlight the benefits of mutability, the more I realize that those cases almost always involve a traversal, in which case an immutable approach is just as performant.

And if one wants to do multiple things to that piece of data, one can just add an optional list of operator functions to pass in and call, passing in that piece to each, e.g. with tail recursion.

At this point, I think my initial concern has been resolved. Mutable implementations are usually just as time-efficient as immutable ones, and the Erlang VM allows them to be just about as space-efficient in most cases.

With the benefits immutability has for concurrent programming, I think in time immutable implementations will replace mutable equivalents.

Another misconception debunked. Thanks!