[clean-list] where clause and list comprehensions

Valery valery at freesurf.fr
Tue Oct 4 22:01:05 MEST 2005


Consider for instance :
l p = [f x \\ x <- [1..] | (f x) rem 2 == 0 &&  p (f x)]
Is there some way to define y = f x once instead of 3 times ?
I didn't manage to have a where clause (inside or outside of the square 
brackets) accepted by the compiler.

Valéry.



More information about the clean-list mailing list