[clean-list] where clause and list comprehension

Valery valery at freesurf.fr
Tue Oct 4 22:35:51 MEST 2005


Consider for instance :
e 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