sumptype
Sumptype is a type construction used in programming languages and type theory to represent a value that may be one of several distinct types. It is commonly called a sum type or tagged union, emphasizing its additive nature: the type is a disjoint union of its variants, each with its own payload.
Construction and syntax often involve declaring multiple variants, each carrying its own data. In pseudocode, a
Semantics and usage revolve around pattern matching or case analysis. Programs typically inspect the tag or
Relation to other concepts: sumptype is the dual of product types and closely mirrors coproducts in category