[GHC] #15269: Qualified Names in --show-iface output

GHC ghc-devs at haskell.org
Mon Jun 18 07:47:04 UTC 2018


#15269: Qualified Names in --show-iface output
-------------------------------------+-------------------------------------
        Reporter:  sjakobi           |                Owner:  (none)
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4852
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > I realized that I don't know the right terminology for names from the
 current module and names from other modules. Is there any? If not, are
 "local" and "non-local" names good words for this?

 A difficulty is that being "from the current module" is not a property of
 a `Name`; it's a property of the `Name` plus the module being compiled;
 see `nameIsLocalOrFrom`.

 See also `Var.hs`:
 {{{
 Note [GlobalId/LocalId]
 ~~~~~~~~~~~~~~~~~~~~~~~
 A GlobalId is
   * always a constant (top-level)
   * imported, or data constructor, or primop, or record selector
   * has a Unique that is globally unique across the whole
     GHC invocation (a single invocation may compile multiple modules)
   * never treated as a candidate by the free-variable finder;
         it's a constant!

 A LocalId is
   * bound within an expression (lambda, case, local let(rec))
   * or defined at top level in the module being compiled
   * always treated as a candidate by the free-variable finder

 After CoreTidy, top-level LocalIds are turned into GlobalIds
 }}}
 So `isLocalId` will reply `True` to a name defined in the current module
 up to `CoreTidy`, but not after.  And all the interface stuff is after.

 Because of this contextual complexity, I suggest you spell out what you
 mean when you say it.

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


More information about the ghc-tickets mailing list