This chapter finishes our look at the core F# language! It deals with two things: first, how we perform conditional logic, such as if/then and, second, the final kind of type supported in F#—the discriminated union—which provides a solution to parts of domain modeling that records and tuples can’t really address. When you finish this, you’ll have a rounded appreciation of the F# type system and understand when to use which component.
We’ve already seen if/then expressions in F#. As it turns out, in everyday F#, they are used only in a couple of specific scenarios because F# has a much more powerful mechanism for conditional logic: pattern matching.