[Colin Paul Adams] Re: Proposal: Define UTF-8 to be the encoding of Haskell source files

Christian Maeder Christian.Maeder at dfki.de
Thu Apr 7 11:29:00 CEST 2011

Am 06.04.2011 20:02, schrieb Bas van Dijk:
> On 6 April 2011 17:34, Colin Paul Adams<colin at colina.demon.co.uk>  wrote:
>> I think the real place to mandate UTF-8 would be for Hackage. That's
>> where it matters (an alternative design would be to add an encoding
>> field in the .cabal file, but I don't think this has much merit).
> That would only allow users of Hackage and Cabal to reliably exchange
> their Haskell files. If we specify it in the report every user can
> benefit.

I agree that Haskell files should be UTF-8, but I also agree that it is 
only relevant for Hackage (and Cabal) and already enforced by ghc-6.12. 
or higher.

The motivation for this proposal can only be that future cabal packages 
will use more and more non-ASCII characters as is possible via 
http://hackage.haskell.org/package/base-unicode-symbols- and
LANGUAGE pragma "UnicodeSyntax" (that happens to have no support for "\" 
as lambda symbol - probably because lambda is a letter and no symbol!)

However, I think, these extra characters only make sense for corner 
cases and should not be recommended for general purposes.

For nicer looking sources I would recommend special viewers or 
post-processors (like haddock or hscolour) that translate certain ASCII 
sequences to unicode points.

So my view is: Stick to ASCII and only if you must (not just for casual 
reasons) use UTF-8.

Cheers Christian

More information about the Haskell-prime mailing list