Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dropDivisibleBy :: Int -> Int -> [Int]
- dropDivisibleBy divisor dividend
- | mod dividend divisor /= 0 || dividend == divisor = [dividend]
- | otherwise = []
- primes :: [Int]
- primes =
- [2 .. 120] >>= dropDivisibleBy 2 >>= dropDivisibleBy 3 >>= dropDivisibleBy 5 >>= dropDivisibleBy 7
- main :: IO ()
- main = print primes
- -- [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement