
11 Aug
2004
11 Aug
'04
1:01 p.m.
On Wed, 11 Aug 2004, Lyle Kopnicky wrote:
Here's my version:
combs [] = [] combs [n] = [[i] | i <- [0..n]] combs (n:r) = let combsr = combs r in [i:cr | i <- [0..n], cr <- combsr]
Since there is one zero combination, it should be
combs [] = [[]]
Then you can also remove the definition of combs [n] . What is the advantage of introducing 'combsr' instead of using 'combs r' immediately?