This change adds support for getting a list of names of all the top level exports of a reified module - see
This change also clarifies that the first field of ModuleInfo reports module usage info rather than module imports - see https://ghc.haskell.org/trac/ghc/ticket/8489#comment:13 . I think this makes more sense than attempting to provide info about declared imports, since I don't see how that information would be useful.
I noticed that there was no convenient way to reify a module given just its name - you also needed to have a package name and construct a 'Module' value. This adds a 'lookupImportedModule' function which can make a 'Module' value for any imported module. The restriction to just imported modules is to make this more deterministic, since they are guaranteed to be present in the environment. This may also improve recompilation detection, though I suspect that in general compilation dependencies due to reification are not yet properly tracked. It makes sense to me to not address that in this patch.