Text in Haskell: a second proposal
Stefan Karrmann
sk@mathematik.uni-ulm.de
Mon, 12 Aug 2002 06:20:34 +0200
Marcin 'Qrczak' Kowalczyk Sat, Aug 10, 2002 at 09:02:30AM +0000:
> Thu, 8 Aug 2002 23:40:42 -0700, Ashley Yakeley <ashley@semantic.org> pisze:
>
> >> 1. Octets.
> >> 2. C "char".
> >> 3. Unicode code points.
> >> 4. Unicode code values, useful only for UTF-16, which is seldom used.
> >> 5. "What handles handle".
I disagree, more general would be:
1. Word8
2. CChar
3. Char (or CodePoint)
4. Word16 (or skipped or (Word8, Word8))
5. Integer, and a function hmax: Handle -> Integer
Choosing Integer for 5 provides compatibilty with old and future systems.
You can have 8 bits for net handles and e.g. 9 bits for files. You can even have
3.32 bits if hmax h returns 10.
Using type 5 as a lowest level a library can provide higher level access with
standard or special encodings.
Sincerly,
--
Stefan Karrmann