F# strongly adheres to immutability, meaning that the values declared in the program cannot be modified once they are constructed. Immutability also makes the code more readable because updates in the program state are more visible; thus it is easier to detect which operations affect the state. There are also F#-specific types, such as tuples, records, discriminated unions, and option types, which are immutable in their nature. They exhibit the following characteristics:
- Being immutable
- Values cannot be null
- Built-in structural equality and comparison
F# has pattern matching as a special feature (from the ML family). We will go through pattern matching over predefined types and then discuss the different structural types and how to construct values with them. In further chapters, we will take a look at all the F#-specific types and ways to declare and use them.