Discriminated unions are similar to enumerations in F#. However, they offer more flexibility. A discriminated union is a set of types where each type can be different whereas each element of an enumeration must be an integer.
Here’s how we can declare a union of months:
type Months = January | February | March | April | May | June
We can then construct a couple of months as follows:
let jan = January
let feb = February
let apr = April
let jun = June
So it’s enough to use the name of the element in the union, we didn’t have to write the fully qualified name “Months.January” like in the case of an enumeration.
Read more of this post