[GHC] #14925: Non-ASCII type names get garbled when their `TypeRep` is shown

#14925: Non-ASCII type names get garbled when their `TypeRep` is shown -------------------------------------+------------------------------------- Reporter: | Owner: (none) leftaroundabout | Type: bug | Status: new Priority: low | Milestone: Component: | Version: 8.2.1 libraries/base | Keywords: Typeable | Operating System: Unknown/Multiple TypeRep Unicode ASCII UTF-8 | Architecture: | Type of failure: Incorrect result Unknown/Multiple | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- [http://hackage.haskell.org/package/base-4.10.1.0/docs/Data-Typeable.html Typeable] allows easily showing the name of a type by, well, using `show` on it. However, this does not work right for types with Unicode symbols in their name: {{{ GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help Prelude> :m +Data.Typeable Prelude Data.Typeable> data W = W Prelude Data.Typeable> typeOf W W Prelude Data.Typeable> data Ω = Ω Prelude Data.Typeable> typeOf Ω Î© }}} This did not yet happen in GHC-7: {{{ GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help Prelude> :m +Data.Typeable Prelude Data.Typeable> data W = W Prelude Data.Typeable> typeOf W W Prelude Data.Typeable> data Ω = Ω Prelude Data.Typeable> typeOf Ω Ω }}} N.b.: {{{ Prelude> import Data.ByteString.Char8 as BC8 Prelude BC8> BC8.putStrLn $ pack "Ω" Ω }}} So, this appears to be a UTF-8 problem – something interprets bytestring- stored type-representation names as a different character encoding. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14925 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14925: Non-ASCII type names get garbled when their `TypeRep` is shown -------------------------------------+------------------------------------- Reporter: leftaroundabout | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: libraries/base | Version: 8.2.1 Resolution: | Keywords: Typeable | TypeRep Unicode ASCII UTF-8 Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect result | Test Case: at runtime | typecheck/T14925 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: => typecheck/T14925 Comment: Very interesting. Test added in Phab:D4512. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14925#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14925: Non-ASCII type names get garbled when their `TypeRep` is shown
-------------------------------------+-------------------------------------
Reporter: leftaroundabout | Owner: (none)
Type: bug | Status: new
Priority: low | Milestone:
Component: libraries/base | Version: 8.2.1
Resolution: | Keywords: Typeable
| TypeRep Unicode ASCII UTF-8
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Incorrect result | Test Case:
at runtime | typecheck/T14925
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14925: Non-ASCII type names get garbled when their `TypeRep` is shown -------------------------------------+------------------------------------- Reporter: leftaroundabout | Owner: (none) Type: bug | Status: patch Priority: low | Milestone: 8.4.2 Component: libraries/base | Version: 8.2.1 Resolution: | Keywords: Typeable | TypeRep Unicode ASCII UTF-8 Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect result | Test Case: at runtime | typecheck/T14925 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4530 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D4530 * milestone: => 8.4.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14925#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14925: Non-ASCII type names get garbled when their `TypeRep` is shown
-------------------------------------+-------------------------------------
Reporter: leftaroundabout | Owner: (none)
Type: bug | Status: patch
Priority: low | Milestone: 8.4.2
Component: libraries/base | Version: 8.2.1
Resolution: | Keywords: Typeable
| TypeRep Unicode ASCII UTF-8
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Incorrect result | Test Case:
at runtime | typecheck/T14925
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4530
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14925: Non-ASCII type names get garbled when their `TypeRep` is shown -------------------------------------+------------------------------------- Reporter: leftaroundabout | Owner: (none) Type: bug | Status: closed Priority: low | Milestone: 8.4.2 Component: libraries/base | Version: 8.2.1 Resolution: fixed | Keywords: Typeable | TypeRep Unicode ASCII UTF-8 Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect result | Test Case: at runtime | typecheck/T14925 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4530 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Merged to `ghc-8.4`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14925#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC