On 1/22/08, Duncan Coutts <duncan.coutts@worc.ox.ac.uk> wrote:
On Tue, 2008-01-22 at 09:29 +0000, Magnus Therning wrote:
> I vaguely remember that in GHC 6.6 code like this
>
> length $ map ord "a string"
>
> being able able to generate a different answer than
>
> length "a string"
That seems unlikely.
Easy!
Prelude> 'å' == '\229'
True
Prelude> 'å' == Char.chr 229
True
Remember, when you type:
Prelude> 'å'
what you really get is:
Prelude> putStrLn (show 'å')
So perhaps what is confusing you is the Show instance for Char which
converts Char -> String into a portable ascii representation.