About Discriminated UnionsDiscriminated unions provide support for values that can be one of a number of named cases, possibly each with different values and types. Discriminated unions are useful for heterogeneous data:
- Data that can have special cases, including valid and error cases
- Data that varies in type from one instance to another
- As an alternative for small object hierarchies.