Last active
December 12, 2015 07:19
-
-
Save Rembane/4735754 to your computer and use it in GitHub Desktop.
This version of Eratosthenes sieve works on infinite lists! :D
This file contains 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
-- A simpler version, should give the same output as the former one. | |
eratosthenes2 (x:[]) = [x] | |
eratosthenes2 (x:xs) = x:eratosthenes2 [y | y <- xs, (mod y x) /= 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment