[Haskell-cafe] External Sort: Sort a 10-million integer file with just 256M of ram.

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Oct 23 13:54:54 EDT 2008

Hello Thomas,

Thursday, October 23, 2008, 8:41:04 PM, you wrote:

> The problem is not fitting a 10^8 element list in memory, the
> following works fine
>  (when compiled, though not in ghci):
> t = putStrLn . show . last $ [1..10^8::Int]

this runs in 1k space, thanks to lazy evaluation. 10^8-length list
needs ~3gb of memory, it was discussed just a few days ago

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list