How to work around GHC bug

Christopher Done chrisdone at googlemail.com
Wed Mar 14 15:16:23 CET 2012


On 14 March 2012 15:08, Ozgur Akgun <ozgurakgun at gmail.com> wrote:

> On 14 March 2012 13:51, Volker Wysk <pf3 at volker-wysk.de> wrote:
>
>> import System
>>
>> main = do
>>
>> [a] <- getArgs
>>
>> putStrLn (show a)
>>
>
> a here is already of type String. If you don't call show on it, it'll do
> the expected thing.


He means that the UTF-8 encoded string passed to the program should be
decoded into unicode points into Chars. So putStrLn (length a) should be 1
were it decoded, but it's actually 2. You can't use this string properly,
there is no Char containing the ä.  See?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20120314/b82433dd/attachment.htm>


More information about the Glasgow-haskell-users mailing list