Danny Gratzer wrote
> Well you've deleted the portion of the code referring to x and y.> listPairs = [(a*b, y) | y <- [0..], a <- [0..], b <- [0..], (a*b) > 5,
>
> (a*b) < 500, (y*y) < 1001, mod y (a*b) == 0]
>oh I see, but as you say it doesn't terminate and I get nothing. Does it
> This will still never terminate however.
mean, that the function is wrong in this place?
Some questions:
1. Does the order of conditions affect the result at all?
2. The "," means AND or &&, right? So how do you write OR || instead? E.g
z<-[1..10] OR z<-[100..110].
Ofcourse it doesn't relate to this topic, but I wanted to know it.
Since I'm a very beginner I think the approach of Daniel is slightly complex
for me to comprehend, right?
Allthough I tried it, but it says isProduct and isSquer are not in Scope, so
I should define them first in WHERE-Clause right?
Thanks again to all
--
View this message in context: http://haskell.1045720.n5.nabble.com/list-comprehension-doesn-t-work-tp5730158p5730167.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe