-
Notifications
You must be signed in to change notification settings - Fork 0
tuples
Bill Hails edited this page May 10, 2026
·
4 revisions
Tuples are collections of values, they differ from lists in a couple of ways
- The length of a tuple is fixed and is part of its type.
- individual values in a tuple can have different types.
Tuples are written between round braces with a leading hash, for example
#(1, 'a', "hello")
is a 3-tuple of (int, char, list(char)).
Tuples are useful when a typedef would be overkill, and additionally you can
unpack tuples by direct assignment within a let, for example
let
fn multiValue() {
#(1, 2, 3)
}
in {
let
#(a, b, c) = multiValue();
in
assert(a == 1 and b == 2 and c == 3)
}
Next: Functions.

CEKF(s) a.k.a. F Natural a.k.a F♮