Encyclopedia

discriminated union

Also found in: Wikipedia.

discriminated union

(theory)
The discriminated union of two sets A and B is

A + B = inA, a) | a in U inB, b)| b in

where inA and inB are arbitrary tags which specify which summand an element originates from.

A type (especially an algebraic data type) might be described as a discriminated union if it is a sum type whose objects consist of a tag to say which part of the union they belong to and a value of the corresponding type.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)
Mentioned in
References in periodicals archive
Those new to F# will learn how to use currying, partial application, and delegation; streamline type creation and safety with record types and discriminated unions; the role of collection types and modules for handling data sets effectively; the use of pattern matching to decompose complex types; make software more responsive; and a great deal more.
Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.