Mon, 15 May 2000 02:45:17 -0700, Simon Marlow <[EMAIL PROTECTED]> pisze:

> OTOH, it wouldn't be hard to change GHC's Char datatype to be a
> full 32-bit integral data type.

Could we do it please?

It will not break anything if done slowly. I imagine that
{read,write}CharOffAddr and _ccall_ will still use only 8 bits of
Char. But after Char is wide, libraries dealing with text conversion
will be possible to be designed, to prepare for future international
I/O, together with Foreign libraries.

CChar will be a newtyped Int8 (or Word8 if char is unsigned), HsChar
will be e.g. unsigned int. These types are fresh, so good time to
do it now. There is an incompatibility with C functions returning a
char called from the natively generated code (without consulting a
C prototype), but it should be extremely rare, and does not affect
char arguments at least on x86.

As for the language standard: I hope that Char will be allowed or
required to have >=30 bits instead of current 16; but never more than
Int, to be able to use ord and chr safely.

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/              GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                  W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to