| |
| |
Tagged union - Wikipedia, the free encyclopedia |
 | | In computer science, a tagged union, also called a variant, variant record, discriminated union, or disjoint union, is a data structure used to hold a value that could take on several different, but fixed types. |
 | | Tagged unions are most important in functional languages such as ML and Haskell, where they are called datatypes and the compiler is able to verify that all cases of a tagged union are always handled, avoiding many types of errors. |
 | | Tagged unions are often accompanied by the concept of a constructor, which is similar but not the same as a constructor for a class. |
| en.wikipedia.org /wiki/Tagged_union (1182 words) |
|