
16 Apr
2009
16 Apr
'09
4:41 a.m.
Heinrich Apfelmus wrote:
+1 except that exporting the potentially infinite list of primes is problematic in that it may become a memory leak.
I'd suggest to export two versions
primes :: [Integer] primes' :: () -> [Integer]
for casual (i.e. throwaway program to solve a Project Euler problem) and for memory aware use respectively.
I'm afraid I don't quite follow. Would you mind explaining what the first parameter is for and how it would solve the memory leak?