It’s About Immutability
Unfortunately, strict purity and the real world don’t play well together. Pure functions can be used to model some domains well, others not so much. Compilers are pure functions. Google’s search is not.
Practical functional programming languages emphasize immutability and functional purity, but they must have some means of modeling a changing world that stops short of total functional purity. In Haskell, probably the most strict functional language, you can model change using monads, and otherwise maintain strict purity.
Other functional languages have other techniques for minimizing and controlling state change that may not be quite as strict as Haskell’s. Clojure, for instance, uses a software transactional memory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access