To this point in the book, it was easy to notice the direct link between the use pattern and the correspondent language feature. For example, Chapter 5, Algebraic Data Types, clearly showed that the native F# algebraic types are substitutes for custom classes. Increased quality and speed of implementations based on algebraic data types reflect the payoff for the feature use.
In this chapter, I will consider a certain language features that do not make the payoff from their use obvious. Nevertheless, these features are ubiquitous in F#. I mean the ambivalent pair of code generalization against the code specialization.
We are going to cover the following topics:
Code generalization techniques, or making the same functional code applicable to multiple function argument types
Code specialization techniques, or making the functional code more specific than usually may be achieved by using standard features
Each of the preceding patterns carries...