tags : Programming Languages, Ocaml
One of / Each of/ Maybe (Ocaml)
The Algebra of Algebraic Data Types - YouTube
 

- One-of typesare more commonly known as- sum types
- each-of typesas more commonly known as- product types.
One of (SUM)
- Ocaml Variants are like disjoint union
- Aka tagged union
- Variants are also known as Algebraic Data types
- Each value of a variant comes from one of many underlying sets
- Thus far each of those sets is just a single constructor hence has cardinality one
- Disjoint union is indeed sometimes written with a Σ operator.
 
- OCaml variants actually combine several theoretically independent language features into one: sum types, product types, recursive types, and parameterized (polymorphic) types.
- Resources
Each of (PRODUCT)
- Ocaml Tuples/records are like Cartesian product
- Each value of a tuple or record contains a value from each of many underlying sets.
- Cartesian product is usually written with a product operator Π or x
Maybe
- Ocaml optionare maybe types