expand :: Matrix [a] -> [Matrix a]
expand = cp . map cpThe inner Cartesian product converts one row of cell choices into its possible rows; the outer product combines those rows into whole matrices. Every assignment is represented exactly once when each cell's alternatives are distinct. Empty cell domains yield no grids, and an empty matrix yields the singleton list containing the empty matrix.
Articles by others on the same topic
There are currently no matching articles.