roam/20210929115234-algebraic_da...

442 B

Algebraic Data Types

Algebraic Data Types are types built by composing other types. This is done in one of two ways:

Product Types
Type T_1 and T_2 and T_n
Sum Types
Type T_1 or T_2 or T_n

Because ADTs are separate from behavior, it's easy to combine them together to make more complex types.