In this chapter, I turn to the F# features that are (almost) missing among mainstream programming languages, such as C#, that are collectively referred to in computer science as algebraic data types (https://en.wikipedia.org/wiki/Algebraic_data_type). They advance primitive data types to the higher type level with the help of the composition of other types (primitive or in-turn composite) which are as follows:
Tuples and records that represent product algebraic data types
Discriminated unions that represent sum algebraic types
I'll cover the same facets for each of these composite types as follows:
Type composition
Type equality and comparison
Type decomposition
Type augmentation
I will revisit the pattern matching as a type decomposition facility that can often be applied outside of the match
construction.