Let's end this section by glancing at some other patterns, where the equivalence may or may not be so good:
- Currying and Partial Application (which we saw in Chapter 7, Transforming Functions – Currying and Partial Application): This can be seen as approximately equivalent to a Factory for functions. Given a general function, you can produce specialized cases by fixing one or more arguments, and this is, in essence, what a Factory does, of course, speaking about functions and not objects.
- Declarative functions (such as map() or reduce()): They can be considered an application of the Iterator pattern. The traversal of the container's elements is decoupled from the container itself. You might also provide different map() methods ...