Thank you, @anon9791410
I can't believe I have missed the product function. 
The product function produces tuples of tuples when more than two sets are involved.
For example:
import Algorithms
let s1 = 0...1
let s2 = 0...1
let s3 = 0...1
let s4 = 0...1
let p1 = product (s1, s2)
let p2 = product (p1, s3)
let p3 = product (p2, s4)
for p in p3 {
print (p)
}
The output of that code is a sequence of tuples of tuples.
(((0, 0), 0), 0)
(((0, 0), 0), 1)
(((0, 0), 1), 0)
(((0, 0), 1), 1)
(((0, 1), 0), 0)
(((0, 1), 0), 1)
(((0, 1), 1), 0)
(((0, 1), 1), 1)
(((1, 0), 0), 0)
(((1, 0), 0), 1)
(((1, 0), 1), 0)
(((1, 0), 1), 1)
(((1, 1), 0), 0)
(((1, 1), 0), 1)
(((1, 1), 1), 0)
(((1, 1), 1), 1)
Is there an easy way get a sequence of flat arrays instead?
[0, 0, 0, 0]
[0, 0, 0, 1]
[0, 0, 1, 0]
[0, 0, 1, 1]
[0, 1, 0, 0]
[0, 1, 0, 1]
[0, 1, 1, 0]
[0, 1, 1, 1]
[1, 0, 0, 0]
[1, 0, 0, 1]
[1, 0, 1, 0]
[1, 0, 1, 1]
[1, 1, 0, 0]
[1, 1, 0, 1]
[1, 1, 1, 0]
[1, 1, 1, 1]