I am trying to write a function that checks if a number is prime. I wrote this :
primeCheck :: Int -> Int -> Bool primeCheck n i | n == 2 = True
The problem is in converting from the Int for use in sqrt. Change the last line to
isPrime n = primeCheck n (floor (sqrt (fromIntegral n)))