ghc-7.8.20140130: The GHC API

Safe HaskellNone
LanguageHaskell98

Finder

Synopsis

Documentation

data FindResultSource

The result of searching for an imported module.

Constructors

Found ModLocation Module

The module was found

NoPackage PackageId

The requested package was not found

FoundMultiple [PackageId]

_Error_: both in multiple packages

NotFound

Not found

findImportedModule :: HscEnv -> ModuleName -> Maybe FastString -> IO FindResultSource

Locate a module that was imported by the user. We have the module's name, and possibly a package name. Without a package name, this function will use the search path and the known exposed packages to find the module, if a package is specified then only that package is searched for the module.

findExactModule :: HscEnv -> Module -> IO FindResultSource

Locate a specific Module. The purpose of this function is to create a ModLocation for a given Module, that is to find out where the files associated with this module live. It is used when reading the interface for a module mentioned by another interface, for example (a "system import").

findHomeModule :: HscEnv -> ModuleName -> IO FindResultSource

Search for a module in the home package only.