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

GHC ghc-devs at haskell.org
Wed Jun 13 20:44:03 UTC 2018


#15269: Qualified Names in --show-iface output
-------------------------------------+-------------------------------------
        Reporter:  sjakobi           |                Owner:  (none)
            Type:  feature request   |               Status:  new
        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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Old description:

> == Motivation
>
> In the Hi Haddock project we use tests based on the `--show-iface` mode.
>
> In the `.hi`-files we dump, we list the `Name`s that may correspond to an
> identifier found in a docstring. In the case of ambiguous identifiers, it
> would be nice to see the module names of the corresponding `Name`s, so we
> can tell them apart.
>
> == Possible solutions
>
> * In Phab:D4806, I proposed to hardcode qualification for `--show-iface`.
> But this may create unwanted noise in different usecases.
>
> * If I could use `-dppr-debug` with `--show-iface` I would do that.
> Currently I get the following error if try:
>
>     {{{
>     Warning: the following files would be used as linker inputs, but
> linking is not being done: NoExportList.hi
>     -dppr-debug: openBinaryFile: does not exist (No such file or
> directory)
>     }}}

New description:

 == Motivation

 In the Hi Haddock project we use tests based on the `--show-iface` mode.

 In the `.hi`-files we dump, we list the `Name`s that may correspond to an
 identifier found in a docstring. In the case of ambiguous identifiers, it
 would be nice to see the module names of the corresponding `Name`s, so we
 can tell them apart.

 For example, for a module containing a docstring `"'elem'"` and a
 declaration for `elem`, we would currently see:

 {{{
 "elem":
   elem
   elem
 }}}

 One `elem` refers to the local one, the other to the one in the `Prelude`.

 What I'd like to see instead is

 {{{
 "elem":
   Data.Foldable.elem
   MyModule.elem
 }}}

 If the output would also contain package names and/or ids, I wouldn't
 mind.

 == Possible solutions

 * In Phab:D4806, I proposed to hardcode qualification for `--show-iface`.
 But this may create unwanted noise in different usecases.

 * If I could use `-dppr-debug` with `--show-iface` I would do that.
 Currently I get the following error if try:

     {{{
     Warning: the following files would be used as linker inputs, but
 linking is not being done: NoExportList.hi
     -dppr-debug: openBinaryFile: does not exist (No such file or
 directory)
     }}}

--

Comment (by sjakobi):

 > It would help me to understand what you are proposing if you could give
 an example of what you currently get with --show-iface and what you'd like
 to get instead.

 I have updated the description.

 > Also, is it really best to work from a textual dump? You could instead
 use the GHC API to load the .hi file into memory, and interrogate it
 directly, perhaps?

 I'm not sure how to integrate tests like that into the GHC testsuite.
 Also, apart from this issue, `--show-iface` works pretty well for me.

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


More information about the ghc-tickets mailing list