Unicode, strings, and Show
Manuel M T Chakravarty
chak at justtesting.org
Thu Mar 31 01:50:45 UTC 2016
Firstly, we have
isPrint :: Char -> Bool
Are you saying that this type is wrong?
Secondly, how often do you feed the output of ’show’ to ’read’ in another locale versus how often is everybody whose whole life is outside of ASCII (i.e., not anglo-centric people) bothered by this shortcoming? (*)
Moreover, the argument on the ticket was that changing the current implementation would go against the standard. Now that I am saying, the current implementation is not conforming to the standard, the standard suddenly doesn’t seem to matter. Personally, I would say, when we wrote that standard, we knew what we were doing.
Manuel
(*) BTW, (read . show) is a pretty bad serialisation story anyway.
> Brandon Allbery <allbery.b at gmail.com>:
>
> On Wed, Mar 30, 2016 at 9:16 PM, Manuel M T Chakravarty <chak at justtesting.org <mailto:chak at justtesting.org>> wrote:
> Thank you for all the replies and especially pointing to this ticket.
>
> I think, the discussion on this ticket is actually misleading and there is a simple solution, which I added as a comment.
>
> That is in fact not simple at all: with that, the ostensibly pure `show` now depends on the user's locale and therefore should be in IO (and you cannot reliably feed it to `read` in a program running in a different locale)! This is why the ticket was concentrating on ghci, where it's at least somewhat reasonable to assume a UTF8 environment.
>
> --
> brandon s allbery kf8nh sine nomine associates
> allbery.b at gmail.com <mailto:allbery.b at gmail.com> ballbery at sinenomine.net <mailto:ballbery at sinenomine.net>
> unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net <http://sinenomine.net/>_______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160331/f7bc57b1/attachment.html>
More information about the ghc-devs
mailing list