[Haskell-cafe] Seeking comments on this IO proposal

Ben Rudiak-Gould Benjamin.Rudiak-Gould at cl.cam.ac.uk
Thu Dec 16 19:09:34 EST 2004


John Goerzen wrote:

 >My proposal is here:
 >
 >  http://www.complete.org/~jgoerzen/t/MissingH.IO.HVIO.html
 >
 >I'm aware that others have been working on IO proposals; specifically,
 >Simon Marlow's here:
 >
 >  http://www.haskell.org/~simonmar/io/System.IO.html

The proposal on Simon M's page was originally my design, though Simon 
made many improvements. You can read my rationale for the original 
design in these mailing-list messages:

    http://www.haskell.org/pipermail/haskell/2003-July/012312.html
    http://www.haskell.org/pipermail/libraries/2003-July/001255.html
    http://www.haskell.org/pipermail/libraries/2003-July/001257.html
    http://www.haskell.org/pipermail/libraries/2003-July/001273.html
    http://www.haskell.org/pipermail/libraries/2003-August/001319.html
    http://www.haskell.org/pipermail/libraries/2003-August/001336.html
    http://www.haskell.org/pipermail/libraries/2003-August/001366.html

I had to abandon many of the original ideas because the Posix and Win32 
APIs can't support them. (Some examples of things you should be able to 
do, but can't in Posix or Win32: given a directory handle and the name 
of a file in the directory, open that file; given a file handle with 
read access, acquire write access if available; conduct atomic 
filesystem transactions.) The most important idea that survives is the 
separation of files from input streams and output streams,

Given this background you can probably guess that I'm not too keen on 
the traditional open/read/write/seek/close model; I don't think it's a 
good abstraction for anything, even files. I love the idea of gzip and 
gunzip as transformations on streams, though, and streams backed by 
memory buffers appear in my proposal too.

 > * Would I be better advised to try to implement some existing ideas
 >   instead?

Yes, you should definitely spend your time implementing my pet idea, not 
yours. :-)

 > * Are there any other implementations of these things that are ready
 >   to use?  (With code)

Simon wrote a prototype implementation of his/my proposal:

    http://www.mail-archive.com/haskell-cafe@haskell.org/msg05138.html


-- Ben



More information about the Haskell-Cafe mailing list