[GHC] #14925: Non-ASCII type names get garbled when their `TypeRep` is shown
GHC
ghc-devs at haskell.org
Thu Mar 15 12:37:24 UTC 2018
#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
More information about the ghc-tickets
mailing list