The type(A,B)
is a type for binary tuples (pairs) of values, one of typeA
and another of typeB
.The type(A,B,C)
is a triple, and so on.
The type(A)
is the same as the typeA
and is not considered a tuple.
The nullary tuple type()
is the type of the unique value also written()
and is pronounced “unit”.
In the standard Unison syntax, tuples ofarity2 and higher are actually of a typeTuple a b
for some typesa
andb
.For example,(X,Y)
is syntactic shorthand for the typeTuple X (Tuple Y ())
.
Tuples are either constructed with the syntactic shorthand(a,b)
(seetuple literals)or with the built-inTuple.Cons
data constructor:(a, b)
.