Composite types
Tuple
A tuple is a fixed-length list of values of different types.
For example:
const p = (0, "a string");
p
is a pair of a nat
and string
values, typed nat * string
.
Find more information in the Declaration section.
Below is the list of tuple-related instructions and operators.
Instructions
Operators
Record
A record is fixed-length list of named values of different types.
For example, a person
record is declared as follows:
record person {
first : string;
last : string;
birth : date;
}
Find more information in the Declaration section.
A literal for the person
record is for example:
const p = {
first = "Albert";
last = "Michelson";
birth = 1852-12-19
};
Below is the list of record-related instructions and operators.
Instructions
Enum
An enumeration is an union of named label types.
For example, float
is either Pos
, Neg
or Zero
:
enum float =
| Pos<nat * nat>
| Neg<nat * nat>
| Zero
Find more information in the Declaration section.
Literals for the sign
enumeration are:
const p = Pos((6, 5));
const n = Neg((3,2));
const z = Zero;
Below is the list of enumeration-related instructions and operators.
Instructions
Operators