+21
nixos/doc/manual/development/option-types.section.md
+21
nixos/doc/manual/development/option-types.section.md
······+A union of types is a type such that a value is valid when it is valid for at least one of those types.+If some values are instances of more than one of the types, it is not possible to distinguish which type they are meant to be instances of. If that's needed, consider using a [sum type](#sec-option-types-sums).+A sum type can be thought of, conceptually, as a *`types.enum`* where each valid item is paired with a type, through some value syntax.+Nix does not have a built-in syntax for this pairing of a label and a type or value, so sum types may be represented in multiple ways.+If the built-in Nix value types provide enough distinction, you simplify your syntax with a [union type](#sec-option-types-unions) instead.