[Haskell-cafe] Writing binary files?

Glynn Clements glynn.clements at virgin.net
Wed Sep 15 11:49:40 EDT 2004


Graham Klyne wrote:

> In particular, the idea of "narrowing" the Char type really seems like a 
> bad idea to me (if I understand the intent correctly).  Not so long ago, I 
> did a whole load of work on the HaXml parser so that, among other things, 
> it would support UTF-8 and UTF-16 Unicode (as required by the XML 
> spec).  To do this depends upon having a Char type that can represent the 
> full repertoire of Unicode characters.

Note: I wasn't proposing doing away with wide character support
altogether. Essentially, I was suggesting making Char a byte and
having e.g. WideChar for wide characters. The reason being that the
existing Haskell98 API uses Char for functions which are actually
dealing with bytes.

In an ideal world, the IO, System and Directory modules (and the
Prelude I/O functions) would have used Byte, leaving Char to represent
a (wide) character. However, that isn't the hand we've been dealt.

-- 
Glynn Clements <glynn.clements at virgin.net>


More information about the Haskell-Cafe mailing list