[GHC] #14436: Teach TemplateHaskell to generate less eye-hurting names
GHC
ghc-devs at haskell.org
Tue Nov 7 15:57:22 UTC 2017
#14436: Teach TemplateHaskell to generate less eye-hurting names
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.4.1
Component: Compiler | Version: 8.2.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
If you look at the Haddocks for, e.g., the `singletons` package, one sees
dozens of signatures containing unsightly names containing long integers.
For instance, in the equation list for
`Data.Singletons.Prelude.Either.IsLeft` we have
{{{
IsLeft (Left _z_6989586621679437436) = TrueSym0
IsLeft (Right _z_6989586621679437439) = FalseSym0
}}}
For definitions with lots of variables things quickly become unreadable.
These names appear this way because they are generated by
TemplateHaskell's `newName` function. This name is ultimately converted to
a GHC `System` name by `Convert.thRdrName`. Such `Name`s are then pretty-
printed including their uniques (see `Name.pprSystem`). I'm not sure I see
the rationale for this. Surely if the names are tidied properly (e.g.
using `TyConRep.tidyType`) there should be no need for the unique suffix.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14436>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list