Cartesian product of types [007X]
In Disco, we can take the Cartesian product of types as well. For example, if we take the Cartesian product of a set of natural numbers and a set of Booleans, the type of the resulting elements is ℕ × Bool:
Disco> {1,2,3} >< {T,F}
{(1, F), (1, T), (2, F), (2, T), (3, F), (3, T)}
Disco> :type {1,2,3} >< {T,F}
{1, 2, 3} >< {T, F} : Set(ℕ × Bool)In this example, ℕ × Bool is the type of the elements, which look like pairs such as (1, F). In general, the type A × B (also written A >< B or A * B) has values that look like ordered pairs (a,b).