Quantcast

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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

GHC - devs mailing list
#13728: Clarify the difference between NameL and NameU in Template Haskell
-------------------------------------+-------------------------------------
           Reporter:  Feuerbach      |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Core           |           Version:  8.0.1
  Libraries                          |
           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:
-------------------------------------+-------------------------------------
 Reading the docs in Language.Haskell.TH.Syntax, I got the impression that
 when reifying the type

 {{{#!hs
 data P a b = P a b
 }}}

 defined outside of TH, the type variables a and b will be NameLs; but in
 my experiments, they come out as NameUs.

 Are NameLs used anywhere at all? In any case, I think the docs should be
 updated to explain the difference clearly.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Loading...