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

Colin Paul Adams colin at colina.demon.co.uk
Wed Apr 6 20:42:58 CEST 2011

>>>>> "Bas" == Bas van Dijk <v.dijk.bas at gmail.com> writes:

    Bas> On 6 April 2011 17:34, Colin Paul Adams <colin at colina.demon.co.uk> wrote:

    >> Allowed? Allowed for what?

    Bas> Allowed to be called a Haskell file.

Well, what the report says on that is irrelevant. If I see a file
containing Haskell code, I shall call it a Haskell file, irrespective. I
suspect I will be in the majority.

    Bas> If the report doesn't specify what a Haskell file is then we
    Bas> can't reliably exchange Haskell source files by only looking at
    Bas> the files themselves.

Sure we can.

    >> What does it achieve? Nothing, as far as I can see. Authors will
    >> still be able to write their Haskell code in any encoding they
    >> like. And any compiler can have a front-end script with an option
    >> to specify the encoding used by source files, which simply uses
    >> iconv on the fly to translate.

    Bas> Suppose I give you MyHaskellFile.hs. But before telling you how
    Bas> it's encoded I go gliding (a hobby of mine). Unfortunately I
    Bas> crash my glider and die :-(. Now what encoding option do you
    Bas> give to your front-end script?

Whatever the encoding happens to be. That won't be hard to find out. And
presumably Haskell programmers don't dies so very frequently that it
will become a time-consuming affair.

    >> 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).

    Bas> That would only allow users of Hackage and Cabal to reliably
    Bas> exchange their Haskell files. If we specify it in the report
    Bas> every user can benefit.

There is no benefit that I see. Anyone is free to write Haskell code in
whatever encoding they fancy. Irrespective of what the report says. It's
not going to have the force of law.
Colin Adams
Preston Lancashire
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

More information about the Haskell-prime mailing list