IO system

Duncan Coutts duncan@coutts.uklinux.net
Sat, 21 Jun 2003 18:02:53 +0100


On Sat, 21 Jun 2003 17:34:59 +0100
Glynn Clements <glynn.clements@virgin.net> wrote:

> > I do not see why the location of data should have an
> > influence here.
> 
> Haskell values are private to the program, while file contents may be
> read and written by other processes.
> 
> Haskell computations can be deferred, omitted or duplicated so long as
> the program's semantics are preserved, but I/O operations must be
> performed as and when specified.

There are some special cases where you could get away with it when the
IO system gives us enough guarantees. You'd have to be very careful
however, to preserve the right semantics.

For example if you could mmap() a file such that changes to the
underlying file were not reflected in the mmap()d region then you could
lazily defer reads from the file. (Unfortunatley MAP_PRIVATE doesn't
quite give this.)

Duncan