IO monad and lazy evaluation
Elke Kasimir
elke@espresto.com
Fri, 23 May 2003 14:03:47 +0200 (CEST)
On 22-May-2003 Glynn Clements wrote:
> The problem isn't monads, or lazy functions, or even the interactions
> between them. The problem is specifically lazy I/O, which is basically
> a fudge which usually works in simple cases.
>
> The "normal" (i.e. strict) I/O functions are perfectly safe.
Since Haskell is lazy by default, I consider lazy file reading to be the more
natural choice, and also a safe one on operating systems like unix who lock a
copy of the file at the time it's opened, and given that such a copy almost
always does not come at such a high cost. Unfortunately, the number of file hand
les is sometimes limited so that one is sometimes forced to close lazily read
files explizitly which is rather tedious...
Elke Kasimir.
--
Elke Kasimir EsPresto AG
-----------------------------------------------------------------
- Software Development- Breite Str. 30-31
Tel/Fax: +49-30-90 226-750/-760 10178 Berlin/Germany