[Haskell-cafe] ANNOUNCE: iterIO-0.1 - iteratee-based IO with pipe operators

dm-list-haskell-cafe at scs.stanford.edu dm-list-haskell-cafe at scs.stanford.edu
Fri May 6 18:28:07 CEST 2011


At Fri, 6 May 2011 10:54:16 -0300,
Felipe Almeida Lessa wrote:
> 
> On Fri, May 6, 2011 at 10:44 AM, Henk-Jan van Tuyl <hjgtuyl at chello.nl> wrote:
> > iterIO cannot be compiled on Windows, because it depends on the package
> > unix.
> 
> That's a big showstopper.  I wonder if the package split I recommend
> could solve this issue, or if it's something deeper.

It's actually worse than this, unfortunately.

The unix package dependency is mostly there for efficiency.  For the
HTTP package, in order to handle things like directories,
If-Modified-Since, and Content-Length, I need to look at file
attributes.  The platform-independent code lets me do this, but I
would have to make many more system calls.  Also, I would have a
slight race condition, because it's hard to get the attributes of the
file you actually opened (to make sure the length hasn't changed,
etc), while the unix package gets me access to both stat and fstat.

This has all been abstracted away by the FileSystemCalls class, so if
there's a way to implement those five functions on Windows, we could
move defaultFileSystemCalls to its own module (or even its own
package), and solve the problem without sacrificing performance or
correctness on unix.

Unfortunately, there are two worse unix dependencies:

 1) I'm using the network IO package to do IO on ByteStrings, and the
    network library claims this doesn't work on windows.

 2) Proper implementation of many network protocols requires the
    ability to send a TCP FIN segment without closing the underlying
    file descriptor (so you can still read from it).  Thus, I'm using
    FFI to call the shutdown() system call on the file descriptors of
    Handles.  I have no idea how to make this work on Windows.

I'm hoping that time eventually solves problem #1.  As for problem #2,
the ideal solution would be to get something like hShutdown into the
system libraries.

I'd obviously love to make my stuff work on Windows, but probably lack
the experience to do it on my own.  Suggestions and help are of course
welcome...

David



More information about the Haskell-Cafe mailing list