18 Apr
2007
18 Apr
'07
8:19 p.m.
Hi, I am a newbie in Haskell and have a trivial question. I am using Simon Thomson's textbook for learning Haskell with Hugs. I am stack with exer 5.10, which asks to define isPrime function using divisors function previously defined. I have managed to define the divisor function like this: divisors :: Int -> [Int] divisors n = [x | x<-[1..n], n `mod` x == 0] but when i am trying with isPrime function using divisors and list comprehension - i am lost because the type signature should be isPrime :: Int->Bool But any list comprehension generates a list, which is not what i want. Any suggestions please? Thank you --------------------------------- Yahoo! Answers - Got a question? Someone out there knows the answer. Tryit now.