[GHC] #9699: TH function to list names in scope

GHC ghc-devs at haskell.org
Mon Jun 22 16:03:57 UTC 2015


#9699: TH function to list names in scope
-------------------------------------+-------------------------------------
        Reporter:  MikeIzbicki       |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Template Haskell  |                 Version:  7.8.3
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Replying to [comment:2 spinda]:
 > Attempt at a rough specification:

 Thanks for putting this together. It's usually best to put this sort of
 specification on a (fresh) wiki page, so it can evolve more easily that is
 possible in a comment chain.

 A few reactions to the spec:

 - The current module's list of exported names might include names that are
 not in scope, due to top-level splices. Recall that in a top-level splice,
 definitions below the splice are not yet in scope, yet might be mentioned
 in an export list. And there might be exported names that there is no way
 to know about: for example, if the export list says `T(..)` and `T`'s
 definition is below a top-level splice, I doubt strongly GHC knows what
 constructors are in `T` when processing the top-level splice.

 - Rename `nestedNames` to `localNames`?

 - `parentNames` is underspecified. (What is returned within a type splice
 within an expression? What about a `let`-bound expression? What about in
 patterns?) I further believe that any tight specification will be woefully
 long and intricate. What is the expected use case of such a function?

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


More information about the ghc-tickets mailing list