
22 May
2007
22 May
'07
7:11 a.m.
On Mon, 21 May 2007, Mark T.B. Carroll wrote:
"Steffen Mazanek"
writes: alg 5 1 = [[1]] alg 5 2 = [[1,1],[2]] alg 5 3 = [[1,1,1],[1,2],[2,1],[3]]
Would this be better?
alg n m = case signum m of -1 -> [] 0 -> [[]] 1 -> [ x : xs | x <- [1..n], xs <- alg n (m - x) ]
This would produce compiler warnings. What about: case compare m 0 of GT -> EQ -> LT -> ?