[Haskell-i18n] Some starters for the new list

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
Thu, 15 Aug 2002 17:20:55 +0000 (UTC)


15 Aug 2002 13:11:46 +0100, Alastair Reid <alastair@reid-consulting-uk.ltd.uk> pisze:

>   data Char   = .. -- unicode
>   data Latin1 = ... -- Latin1

I don't see much use of this. If we want to select encoding dynamically
(e.g. mail / news / WWW / irc client which selects it explicitly basing
on metadata or user settings), they can't all use their own types.

Internal texts will probably be Unicode, externally they are streams
of bytes (of Word8).

>    instance String FrenchString where
>      fromString (FS "General Protection Fault") = "..."
>      fromString (FS "File not found") = "..."
>      ...
>      fromString (FS _)                = ????

Such data is usually read from files, and the language is usually
chosen dynamically basing on user settings. Again different languages
can't use their own types.

The fact that translating a string requires IO will cause trouble.
Perhaps we should hide this IO in a function which appears to be pure
(uses unsafePerformIO internally and uses the locale from the time the
"function" was created, not affected by a setlocale equivalent).

-- 
  __("<      Marcin Kowalczyk
  \__/     qrczak@knm.org.pl
   ^^    http://qrnik.knm.org.pl/~qrczak/