summaryrefslogtreecommitdiff
path: root/31-41/31.hs
diff options
context:
space:
mode:
Diffstat (limited to '31-41/31.hs')
-rw-r--r--31-41/31.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/31-41/31.hs b/31-41/31.hs
new file mode 100644
index 0000000..d6d53a9
--- /dev/null
+++ b/31-41/31.hs
@@ -0,0 +1,4 @@
+isPrime :: Int -> Bool
+
+isPrime 1 = False
+isPrime x = and $ map (\y -> x `mod` y /= 0) $ fst $ span (\y -> y * y <= x) [2..]