Functional programming has developed design patterns just like object-oriented or other communities. These patterns, unsurprisingly, make use of functions as a central concept. They also emphasize something called the single responsibility principle. The single responsibility principle states that program's logical components should do one thing and do that one thing well. In this chapter, we will focus on a few very common patterns. Some of these concepts are so simple that they counter-intuitively become harder to explain. In these cases, we will make use of various examples to demonstrate how a simple concept can exhibit complex behavior.
In this chapter, you will do the following:
- Learn to recognize and use functors
- Learn to recognize and use monads
- Learn to recognize and use combinators
- Learn to recognize and use lazy evaluation