IO monad and lazy evaluation

Elke Kasimir elke@espresto.com
Mon, 26 May 2003 13:58:50 +0200 (CEST)


On 23-May-2003 Glynn Clements wrote:
> 
> Elke Kasimir wrote:
>> 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,
> 
> I'm not quite sure what you're saying here, but I think that you're
> wrong. It appears that you are confusing Unix (which doesn't lock
> files automatically) with Windows (which automatically locks a file
> unless the program indicates that it allows concurrent access).

You're right - My use of the term "locked" is inappropriate and obviously 
confusing. What I was trying to indicates is that if some file "Foo" is opened 
using >> readFile "Foo" << the effect is that you get an object that can't be 
changed from the outside, so that it is not so important to ensure that the read
 operation on that file is finished at some specific point in 
time, and even may be never known to have been finished for sure. If it was 
possible to open arbitrary many files that way - and opening "the same file"
arbitrary many times for reading, "not so important" could be changed into "not 
important" in the previous statement.

Best,
Elke.


--  
Elke Kasimir                             EsPresto AG
-----------------------------------------------------------------
- Software Development-                Breite Str. 30-31 
Tel/Fax: +49-30-90 226-750/-760   10178 Berlin/Germany