blob: 68909d746445e46a3a9b8b834f4ff543639a56dc (
plain) (
blame)
1
2
3
4
5
|
primesR :: Int -> Int -> [Int]
primesR l r = takeWhile (<= r) $ dropWhile (< l) primes
where primes = filterPrime[2..]
filterPrime (p:xs) = p:filterPrime [x | x <- xs, x `mod` p /= 0]
|