[Haskell-cafe] I/O interface

Keean Schupke k.schupke at imperial.ac.uk
Sun Jan 16 13:40:37 EST 2005

Marcin 'Qrczak' Kowalczyk wrote:

>Convenience. I'm worried that it uses separate types for various
>kinds of streams: files, pipes, arrays (private memory), and sockets.
>Haskell is statically typed and lacks subsumption. This means that
>even though streams are unified by using a class, code which uses
>a stream of an unknown kind must be either polymorphic or use
>existential quantification.
Or uses specialise pragmas to provide concrete implementations
for a polymorphic function.

>>Exploiting the advantages of mapped files for stream I/O
>> http://www.cs.toronto.edu/pub/reports/csrg/267/267.ps
>The advantage of reducing copying between buffers is lost in Haskell:
>file{Read,Write} use a buffer provided by the caller instead of giving
>a buffer for the caller to examine or fill.
Eh? Surely that just depends on the API. The BlockIO library does
exactly this (passes the blocks to a user provided callback function)


More information about the Haskell-Cafe mailing list