Chapter 11. Implementing Design Patterns - The Functional Way
In Chapter 10, Ensuring Purity - Immutability, we saw several functional techniques to solve different problems. However, programmers who are used to employing OOP may find that we have missed some well-known formulae and solutions, which are often used in imperative coding. Since design patterns are well known, and programmers will be likely already be aware of how they are applied in other languages, it's important to take a look at how a functional implementation would be done.
In this chapter, we shall consider the solutions implied by design patterns, which are common in OOP to see their equivalences in FP. In particular, we will study the following topics:
- The concept of design patternsand to what they apply
- A few OOP standard patterns and what alternative we have in FP, if we need one
- A discussion about FP design patterns, not related to the OOP ones