Unicode

Martin Norbäck d95mback@dtek.chalmers.se
08 Aug 2002 14:21:49 +0200


--=-efIKESDgFcvUkHkB4pey
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

tor 2002-08-08 klockan 13.25 skrev ck15:
> Hi,
>        Is there a way to include symbols like set  union , set
> intersection etc in Haskell code ?

Reference from http://www.haskell.org/onlinereport/lexemes.html (Haskell
98 report)

"Haskell uses a pre-processor to convert non-Unicode character sets into
Unicode. This pre-processor converts all characters to Unicode and uses
the escape sequence \uhhhh, where the "h" are hex digits, to denote
escaped Unicode characters. Since this translation occurs before the
program is compiled, escaped Unicode characters may appear in
identifiers and any other place in the program."

So, you should be able to use the following:

\u222a =3D set union
\u2229 =3D set intersection
etc.

These characters should be allowed as operators, since they are unicode
symbols, but neither ghc 5.04, hugs December 2001 or nhc98 1.14 accepts
this syntax. As a matter of fact they all complain about an unexpected
\. I couldn't find any compiler flag to make it compile either.

The programs tested was

a \u222a b =3D undefined

I also tested the more normal

\u0061 =3D undefined

but none worked.

Am I wrong here or is nobody following the standard? Another question is
what happens to layout with these characters (6 spaces or 1?).

Would it be feasible to allow, say, UTF-8 input instead, by some pragma
or compiler flag? Would be very slick, since many editors support UTF-8,
but not many support the \uhhhh notation. Same problem with layout of
course.

Regards,

	Martin

--=20
Martin Norb=E4ck          d95mback@dtek.chalmers.se             =20
Kapplandsgatan 40       +46 (0)708 26 33 60                   =20
S-414 78  G=D6TEBORG      http://www.dtek.chalmers.se/~d95mback/
SWEDEN                  OpenPGP ID: 3FA8580B

--=-efIKESDgFcvUkHkB4pey
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: För information se http://www.gnupg.org/

iD8DBQA9UmJdkXyAGj+oWAsRAoTKAJ9pCxgf0FfYh7APr2JEiKqwZQyynwCgjgkS
0e7X85vycVWe3fuo2QC60Q8=
=iojC
-----END PGP SIGNATURE-----

--=-efIKESDgFcvUkHkB4pey--