
On Tue, Jul 17, 2007 at 04:16:29AM -0500, Ben wrote:
hi folks --
a haskell newbie here, searching for comments and wisdom on my code.
i had a project to try to implement "external sort" in haskell as a learning exercise. (external sort is sorting a list that is too large to fit in main memory, by sorting in chunks, spooling to disk, and then merging. more properly there probably should be multiple stages, but for simplicity i'm doing a one-stage external sort.)
If you have practical (as opposed to pedagogical) reasons for this, you should try using 'sort' from GNU coreutils (standard sort on linuxen, shouldn't be terribly hard to make work on other systems if you know C). The inner loop is coded with pretty bad constant factors, but it *is* an external sort, and has happily sorted 20GB files on my (300MB core) system; only taking an hour. Stefan