Last active
November 2, 2020 08:27
-
-
Save ahafidi/f7b9bae67d846339ba3f02e9f886a6b8 to your computer and use it in GitHub Desktop.
Haskell — Prime numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primes = filterPrime [2..] | |
where filterPrime (p:xs) = | |
p : filterPrime [x | x <- xs, x `mod` p /= 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment