- Scala Design Patterns.
- Ivan Nikolov
- 56字
- 2021-08-27 19:09:59
Increased expressivity
As you can see from the examples, unifying classes and functions leads to increased expressivity and we can easily achieve various things such as callbacks, lazy parameter evaluation, centralized exception handling, and others, and without writing extra code and logic. Moreover, functions as classes mean that we can extend them to provide extra functionality.