2008/6/23 leledumbo <[EMAIL PROTECTED]>:
>
> I give up %-|, I'll go back to Pascal instead. Thanks for your answers.

Don't give up so fast !! (Note that you can't do what you asked for in
Pascal either, in fact Pascal don't support n-uplet)

A recursive way to do it is :

findAllAns 0 0 = [[]]
findAllAns 0 s = []
findAllAns n s = [ x:xs | x <- [0..s], xs <- findAllAns (n - 1) (s - x) ]


For all those little questions that bug you, you'll get your answers
faster by asking on the #haskell channel on irc.freenode.org .

-- 
Jedaï
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to