= Solution
The empty family has one choice, the empty selection:
``
cp :: [[a]] -> [[a]]
cp = foldr extend [[]]
where
extend choices suffixes = [x:ys | x <- choices, ys <- suffixes]
``
A selection from the whole family consists uniquely of a choice from its first member and a selection from the remaining family. This bijection proves the combining equation and completeness by <induction>. If a member family is empty, there are no selections. The base is `[[]]`, not `[]`: otherwise every <Cartesian product> would incorrectly be empty.
Back to article page