Re: [GHC] #11632: read (show "ó1") fails (was: Data.Char repeated readLitChar barfs on output from show "ó1")

GHC ghc-devs at haskell.org
Tue Feb 23 22:00:19 UTC 2016


#11632: read (show "ó1") fails
-------------------------------------+-------------------------------------
        Reporter:  inversemot        |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:
       Component:  libraries/base    |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by rwbarton):

 * priority:  normal => high


@@ -0,0 +1,5 @@
+ {{{
+ Prelude> let s = "ó1" in read (show s)
+ *** Exception: Prelude.read: no parse
+ }}}
+
@@ -4,3 +9,4 @@
- readLitChar "\"\\243\\&1\"" = [("\"", "\243\\&1")]
- readLitChar "\243\\&1" = [("\243", "\\&1")] --should have consumed "\\&"
- readLitChar "\\&1" = []
+ readLitChar "\"\\243\\&1\"" = [('"', "\\243\\&1\"")]
+ readLitChar "\\243\\&1\"" = [('\243', "\\&1\"")] --should have consumed
+ "\\&"
+ readLitChar "\\&1\"" = []

New description:

 {{{
 Prelude> let s = "ó1" in read (show s)
 *** Exception: Prelude.read: no parse
 }}}

 "ó1" is "\243\&1" and when shown that's `"\"\\243\\&1\""`

 {{{#!hs
 readLitChar "\"\\243\\&1\"" = [('"', "\\243\\&1\"")]
 readLitChar "\\243\\&1\"" = [('\243', "\\&1\"")] --should have consumed
 "\\&"
 readLitChar "\\&1\"" = []
 }}}

--

Comment:

 Thanks for the report. I fixed some errors in the ticket description, hope
 this is what you meant.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11632#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list