[clean-list] Help with list comprehension
Frantisek Fuka
fuxoft@terminal.cz
Sun, 03 Jun 2001 11:25:03 +0200
I'm working my way through the Clean Book and I'm stumped by exercise 5
in Chapter 3.10:
"Write a list comprehension for generating all permutations of some
input list."
The list of length "len" has "len!" permutations so it seems to me that
the comprehension (generating list of lists) should look like this:
[[...generate one permutation...] \\ i <- [1..len], j <- [1..len-1], k
<-[1..len-2] ... z <- [1..2]
But I don't know how to create a comprehension with variable number of
generators or how to create a recursion inside the comprehension...
--
Frantisek Fuka
(yes, that IS my real name)
(and it's pronounced "Fran-tjee-shek Foo-kah")
----------------------------------------------------
My E-mail: fuxoft@terminal.cz
My Homepage: http://www.fuxoft.cz
My ICQ: 2745855