
6 Apr
2009
6 Apr
'09
12:28 a.m.
It opens and closes each file in turn; but it would it be unwise to open and close each file as we'd read a chunk from it? This would allow arbitrary interleaving.
If I understand you correctly, you are proposing processing several files in parallel, so to interleave IO. If the `files' in question are communication pipes, or if KAIO (kernel asynchronous IO) is available, it is indeed a good strategy. The last example in the file http://okmij.org/ftp/Haskell/Iteratee/IterateeM.hs (called test_driver_mux) demonstrates how to interleave IO with Iteratees. Iteratees of course do not care how the source data have been obtained, with or without interleaving.