Algebraic data type

Algebraic Data Types (ADT) are a combined type formed from other data types. They are usually of two kinds: sum type or product type. The type can be divided into smaller parts, and this is called a subtype. Sum types can use one or the other of the subtypes it contains. Product types use all the subtypes it contains at the same time. 

The number of elements of each subtype is counted. Sum types and product types do so differently. For a sum type with 3 subtypes (A, B, C) that each has 5 elements, the sum of them combined equals 15 (5 + 5 + 5). For the product type, it would equal 125 (5 * 5 * 5), the product of all combinations for every element in the subtype.

Uses
Some notable languages that use algebraic data types:

References

Category:Computer science
Category:Computer terminology