[Haskell-cafe] Re: Looking for the fastest Haskell primes

Niemeijer, R.A. r.a.niemeijer at tue.nl
Thu Apr 16 04:41:43 EDT 2009


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?


More information about the Haskell-Cafe mailing list