[GHC] #11584: [Template Haskell] Language.Haskell.TH.Syntax.hs contains misleading comment

GHC ghc-devs at haskell.org
Mon Feb 22 14:34:47 UTC 2016


#11584: [Template Haskell] Language.Haskell.TH.Syntax.hs contains misleading
comment
-------------------------------------+-------------------------------------
        Reporter:  bollmann          |                Owner:  bollmann
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  7.10.3
      Resolution:                    |             Keywords:  newcomer
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Documentation     |  Unknown/Multiple
  bug                                |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Ah, yes, that makes some sense. When the pretty-printer appends `_xyz` to
 an identifier, that's the identifier's `Unique`. TH `Name`s sometimes lead
 to identifiers with `Unique`s (e.g., `newName` identifiers and identifiers
 from quoting) and sometimes not (`mkName`). In the latter case, the
 variable will refer to the innermost identifier with the same name,
 regardless of its `Unique`.

 I agree the pretty-printer is confusing here. Maybe instead of `x_a3uK`,
 it should be `x{a3uK}`? It would then be clear that the underscore isn't
 part of the name proper. Not sure if this is better or worse.

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


More information about the ghc-tickets mailing list