3 ms·
The problem is laziness. Lazy IO just makes it happen with files, which is more noticeable. In regular lazy code it happens with memory instead (space leaks).
by cousin_it 10y ago
The problem is laziness. Lazy IO just makes it happen with files, which is more noticeable. In regular lazy code it happens with memory instead (space leaks).
- fbreduc 10y agothese are not problems, only small details that you have to be careful of..not a large tradeoff to pay
- marcosdumay 10y agoThat's like saying that bounds overflow in C isn't a problem, just something you have to be careful of. To tell you the true, I can't understand why the code the OP talks about has a problem, and I can't even reproduce the problem (and never saw any of the problems of lazy IO in practice either). But I also can not say the code has no problem, and that is a big issue with the language.
- lomnakkus 10y ago> That's like saying that bounds overflow in C isn't a problem, just something you have to be careful of. I think there's a significant difference between undefined behavior (hello security flaws!) and the program crashing in a (reasonably) well-defined way.
- lomnakkus 10y agoEDIT: I was wrong. It seems to actually just be a hideously inefficient in-memory representation of the data (akin to List[Char]) perhaps plus a space leak. That's what I get for not reading the code carefully...