algebraic data types
Tagged union constructs
Algebraic data types are a way of defining composite types in programming by combining simpler types.
A sum type offers alternatives—a value is one of several possibilities.
A product type bundles values together—a value contains all of several components.
Languages like Haskell, Rust, and ML make heavy use of them: The Result type is either Ok or Err.
The "algebraic" refers to how types can be added (sum) and multiplied (product) like mathematical operations.
- typesVarieties or key-enters
- rustIron oxide coating
- unionsCombinations or confederations
- enumerationSequential listing of items
- pattern matchingDetecting consistent structures
structures · composites · product type · product · constructors · variants · sum · monads · polymorphism · list · recursion · tuple · match · case · struct · tree · record · inductive
algebra, algebraic, algebras, algebraically, prealgebra, linear algebra, datatype