
GHC 5.02.[23] seems to be quite strict about literal strings in source code. I presume this is a feature. :-) However this is annoying for people who want to use wide chars in strings in source code. (Though I realise that doing so is not very "portable".) To illustrate, the following program main :: IO () main = let ja = 'Japanese character' in putChar ja >> putChar '\n' results in Compiling Main ( test-ja.hs, interpreted ) test-ja.hs:3: error in character literal Failed, modules loaded: none. with both ghc and ghci. Is anything allowed in literal strings except ascii? utf-8? Jens

this has bitten me in the last day or so too. i regularly use utf-8 in my comments and would like to see them in string literals too. foo :: ∀αβ . α → β looks much prettier than the alternative. just utf-8 support would be quite easy and cover 99% of peoples needs anyway. John On Sun, Apr 14, 2002 at 01:57:31AM +0900, Jens Petersen wrote:
GHC 5.02.[23] seems to be quite strict about literal strings in source code. I presume this is a feature. :-) However this is annoying for people who want to use wide chars in strings in source code. (Though I realise that doing so is not very "portable".)
To illustrate, the following program
main :: IO () main = let ja = 'Japanese character' in putChar ja >> putChar '\n'
results in
Compiling Main ( test-ja.hs, interpreted ) test-ja.hs:3: error in character literal Failed, modules loaded: none.
with both ghc and ghci.
Is anything allowed in literal strings except ascii? utf-8?
-- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@repetae.net ---------------------------------------------------------------------------

On Sun, Apr 14, 2002 at 01:57:31AM +0900, Jens Petersen wrote:
Is anything allowed in literal strings except ascii? utf-8?
Well, it handles isolatin characters correctly (iso8859-1). I've played with the Euro Symbol (€) and had no problem either (iso8859-15) On Sunday 14 April 2002 01:01, John Meacham wrote:
this has bitten me in the last day or so too. i regularly use utf-8 in my comments and would like to see them in string literals too. foo :: ∀αβ . α → β looks much prettier than the alternative.
Note: Not that pretty in here, maybe it's my system fault, even though I have utf-8 suport. I do see the alphas and betas, but have no Idea what that square is - Linux/KDE3.0/Kmail. Well that would be nice. Meanwhile, one possibility for xemacs users, would be something like the proofgeneral package (http://www.proofgeneral.org) for haskell. Besides morphing xemacs into a really nice IDE, it renders some keywords to non-ascii symbols (like greek letters) using the xsymbol package. That, combined with a slightly modified literate haskell LaTeX style would be really nice. J.A.
participants (3)
-
Jens Petersen
-
John Meacham
-
Jorge Adriano