Text in Haskell: A PROPOSAL

Alastair Reid alastair@reid-consulting-uk.ltd.uk
08 Aug 2002 01:42:36 +0100


> It's often very useful to treat a file as a sequence of characters;
> in fact I'd say that's probably more common than treating them as a
> sequence of octets.  But both are clearly needed.

> hPutWord8 :: Handle -> Word8 -> IO () should be available _in
> addition to_ hPutChar, for applications that need to treat files as
> a sequence of octets.

>> >These two uses are inconsistent, and must be separated.  I agree.

How different is this from the idea of open a file in binary mode and
in text mode?  I know that Hugs distinguishes the two because I
remember the case that triggered the requirement: generating MIDI
files on Win32.

I guess what I'm saying is do we need new read/write operations or
just new open operations?

--
Alastair Reid                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/