Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

11 lines (10 sloc) 0.318 kb
isPrime :: Int -> Bool
isPrime n
| n <= 1 = False
| otherwise = not $ any (\x -> n `mod` x == 0) [2,3..(n-1)]
main = do
print $ isPrime 10 -- False
print $ isPrime 1 -- False
print $ isPrime 2 -- True
print $ isPrime 3 -- True
print $ isPrime 13 -- True
Jump to Line
Something went wrong with that request. Please try again.