I hereby claim:
- I am electrocutie on github.
- I am electrocutie (https://keybase.io/electrocutie) on keybase.
- I have a public key ASDKaTj1zKxT1O4hYIKcLIMtpD_dl4AYTbwsNPyE6MgmNgo
To claim this, I am signing this object:
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Data.ListConsumer ( | |
ListConsumer, takeN, peekN, dropN, takeAll, takeAny, runL, runFoldableL | |
) where | |
import Control.Applicative | |
import Control.Arrow | |
import Control.Monad |
I hereby claim:
To claim this, I am signing this object:
sieve :: [Int] | |
sieve = 2 : ([3,5..] >>= test sieve) | |
where | |
test p c = test' p c $ floor . sqrt . fromIntegral $ c | |
test' (p:ps) c lim --primes and candiate | |
| p > lim = [c] | |
| rem c p == 0 = [] | |
| otherwise = test' ps c lim |