There are a number of common design patterns for functional programming. These are typical approaches to functional programming that are used in a variety of contexts.
Note the important distinction from object-oriented design patterns. Many OO design patterns are designed to make management of state more explicit, or aid in composition of complex, emergent behavior. For functional design patterns, the focus is almost always on creating complex behavior from simpler pieces.
There are many common functional design approaches shown throughout this book. Most have not been presented with a particular name or story. In this section, we'll review a number of these patterns.
- Currying: This can be called a partial function application and is implemented with the partial() function in the functools module. The idea is to create a...