Friedrich wrote:
Paul Johnson <[EMAIL PROTECTED]> writes:
[...] Because file reading is lazy,
each line is only read when it is to be processed, and then gets
reaped by the garbage collector.  So it all runs in constant memory.
Would you mind to elaborate a bit about it. What's so terrible to open
one file after the other, reading it line by line and close the file
thereafter.
Its not wrong, its just more work. Also from a structural point of view its better to separate the code that reads the files from the code that processes the text. The conventional way forces you to mix them.

(By the way, putting in the top level type declarations helps a lot
when you make a mistake.)
Well I have my problems with that. Probably it comes from using
Languages like Ruby and my special dislike of "typing things" comes
especially from Java, C++ (well C is not "innocent" in that regard
also.
OK, its a matter of personal preference (although it really does help anyone else reading your code). However I find that if I leave out the top level definitions then type error messages at compile time are much harder to figure out, especially in a big program. So I find that the extra typing pays in the long run. :-/

Paul.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to