
5 May
2016
5 May
'16
1:57 p.m.
I succeeded to get it working with n = 2,000,000 at least, through this means: primesBelow :: Int -> [Int] primesBelow max = list where list = 2:3:rest rest = [ v | k <- [1..(max-1)`div`6], i <- [-1, 1] , let v = 6*k+i, checker v] ... ... the function "checker" (in the list comprehension, as conditional) is using itself in its definition the variable "list" to generate the test for each "v" of the list comprehension "rest". I dunno if this kind of recursion suits you.