[GHC] #13728: Clarify the difference between NameL and NameU in Template Haskell

GHC ghc-devs at haskell.org
Mon May 22 02:35:09 UTC 2017


#13728: Clarify the difference between NameL and NameU in Template Haskell
-------------------------------------+-------------------------------------
        Reporter:  Feuerbach         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Documentation     |  Unknown/Multiple
  bug                                |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by goldfire):

 * component:  Core Libraries => Template Haskell


Comment:

 It looks like `NameL`s are used when a quotation in a splice mentions an
 in-scope variable:

 {{{
 f x = $(do VarE stuff <- [| x |]
            runIO $ putStrLn $ case stuff of
              Name _ (NameS {}) -> "NameS"
              Name _ (NameQ {}) -> "NameQ"
              Name _ (NameU {}) -> "NameU"
              Name _ (NameL {}) -> "NameL"
              Name _ (NameG {}) -> "NameG"
            [| 0 |])
 }}}

 prints `NameL` when compiled. Yes, this should be clarified in the
 documentation.

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


More information about the ghc-tickets mailing list