In this chapter, we have introduced the concept of pure functions and studied why they matter. We have also seen the problems caused by side effects, one of the causes of impure functions; considered some ways of purifying such impure functions, and finally, we have seen several ways of doing unit tests, for both pure and impure functions.
In Chapter 5, Programming Declaratively - A Better Style, we'll show other advantages of FP: how you can program in a declarative fashion, at a higher level, for simpler, more powerful code.