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