
11 Aug
2004
11 Aug
'04
12:24 a.m.
G'day all. At 06:01 10/08/04 +0200, Florian Boehl wrote:
If I know the length 'l' of the 'locklist', I can solve the problem via generators. E.g.:
l = 2: [[a,b] | a <- [0..locklist!!0], b <- [0..locklist!!1]]
But if the length is unknown (because it's dynamic) this solutions (of course) fails. Is it possible to solve this problem in haskell in an elegant way?
This is a transformation that it's useful to know about: [ E | x <- Xs, y <- Ys ] = concat [ [ E | y <- Ys ] | x <- Xs ] Whether or not it's any use to you is another matter. :-) Cheers, Andrew Bromage