Re: Word8-Based IO
Ketil Z. Malde <ketil <at> ii.uib.no>
2002-08-21 07:52:24 GMT
Ashley Yakeley <ashley <at> semantic.org> writes:
> Was there any kind of consensus emerging on this?
I think we agreed, more or less, on low-level Word8-based IO, and Char
based functions on top of this doing encoding/decoding. (Possibly
implementing Char functions natively for speed, but I suggest delaying
that until it becomes a problem)
> Leaving aside what might be done with the Char-based functions (and
> people seem to think they're fine as is)
Well, clearly, they need to be able to incorporate the encodings
people are going to use. Just stuffing in Word8's works fine for now,
but we should probably reimplement in terms of Word8 IO, and after
that, wrap at least an UTF-8 coder. (I occasionally need something
to translate UTF-8 mail to ISO-8859-1, this sounds like a simple way
to get a feel for Unicode IO, and is probably a good alternative to
upgrading Gnus
> I'd like to suggest the following:
> * System.IO: addition of new Word8-based functions
>
> hGetOctet :: Handle -> IO Word8
> hLookAheadOctet :: Handle -> IO Word8
> hPutOctet :: Handle -> Word8 -> IO ()
> hPutArray :: Handle -> [Word8] -> IO ()
> hLazyGetArray :: Handle -> IO [Word8]
>
(Continue reading)