恩欧式联合

类型信息不需要包含在歧视联合的情况下。通过省略类型信息,你可以创建一个简单表示一组选项的联合,类似于枚举。

// This union can represent any one day of the week but none of 
// them are tied to a specific underlying F# type
type DayOfWeek = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday