
I can't compile this function change :: Char -> Char change 'a' = 'b' change x = x if I replace 'b' with a non-ascii character. The compiler complaints "Character literal with length>1". Antonio Regidor García ______________________________________________ Renovamos el Correo Yahoo!: ¡100 MB GRATIS! Nuevos servicios, más seguridad http://correo.yahoo.es

Antonio Regidor García
I can't compile this function
change :: Char -> Char change 'a' = 'b' change x = x
if I replace 'b' with a non-ascii character. The compiler complaints "Character literal with length>1".
The Haskell'98 Report says: Haskell uses the Unicode [11] character set. However, source programs are currently biased toward the ASCII character set used in earlier versions of Haskell. I'm afraid it is still true that all the compiler implementations accept only 8-bit characters in source files. You can notate a larger character with a hex escape e.g. '\x10d5', but often this is truncated to the lower 8-bits on output. The use of Unicode in Haskell remains a hope, not a reality. Regards, Malcolm
participants (2)
-
Antonio Regidor García
-
Malcolm Wallace