Each-of types; a value of type t contains values whose types follow each oft1, t2, t3, …, tn (e.g. tuples, records)
int * bool contains each of the following:
intboolint * bool contains an int AND a boolOne-of types; a value of type t contains values whose types follow one of t1, t2, t3, …, tn (e.g. enumerations, itemizations)
NONESOME eint option either contains no data (NONE) OR some data (SOME int)Self-reference (self-referential data types e.g. lists, trees)
xs is one of the following:
NONESOME (x :: xs)xs is…
int and an int listNONE or SOME (x :: xs).xs references itself in its type comment.<aside> 💽 Records are also called structures (…sound familiar?)
</aside>
Records are a form of compound data that encapsulates multiple pieces of related data.
They are identical to structures and bear some similarities to objects from OOP languages.
Syntax: {f1 = v1, f2 = v2, f3 = v3, ... fn = vn}, where f1...fn are field names and v1...vn are values.
Type-checking rules: {f1 : t1, f2 : t2, f3: t3, ... fn : tn}, where f1...fn are field names and t1...tn are the types of values v1...vn.