check for prime number haskell code example Example: check if number is prime haskell isPrime k = length [ x | x <- [2..k], k `mod` x == 0] == 1