[GHC] #8489: clean up dependency and usages handling in interface files

GHC ghc-devs at haskell.org
Thu Nov 20 14:52:10 UTC 2014


#8489: clean up dependency and usages handling in interface files
-------------------------------------+-------------------------------------
              Reporter:  errge       |            Owner:  errge
                  Type:  task        |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  Template    |          Version:  7.7
  Haskell                            |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Moderate (less
  Unknown/Multiple                   |  than a day)
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Aha I see.  So this is really a bug, thus:
  * Template Haskell offers
 {{{
 reifyModule :: Module -> Q ModuleInfo
 data ModuleInfo = ModuleInfo [Module]
   -- Contains the import list of the module
 }}}

  * The "import list of the module" M presumably means the list of modules
 that M imports directly.  (Clarifying the comment would be good.)

  * But the program above shows that `reifyModule` reports a much longer
 list.  (NB: A smaller test case would make easier.)

 So the specification is simply to make `reifyModudule` behave as
 advertised.

 Now I understand, it's easy enough to implement, at least for modules in
 the same package as M.  Just pick modules whose `Usage` has `Just _` in
 its `usg_exports` field.  Sadly, for modules from other pacakges we simply
 don't record the necessary information in interface files at all.  It
 would not be hard to fix this.

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


More information about the ghc-tickets mailing list