summaryrefslogtreecommitdiff
path: root/31-41/31.hs
blob: d6d53a9d27f9944310ac3d13827a3b9b0df41931 (plain) (blame)
1
2
3
4
isPrime :: Int -> Bool

isPrime 1 = False
isPrime x = and $ map (\y -> x `mod` y /= 0) $ fst $ span (\y -> y * y <= x) [2..]