- depanal :: GhcMonad m => [ModuleName] -> Bool -> m ModuleGraph
- load :: GhcMonad m => LoadHowMuch -> m SuccessFlag
- data LoadHowMuch
- topSortModuleGraph :: Bool -> [ModSummary] -> Maybe ModuleName -> [SCC ModSummary]
- noModError :: DynFlags -> SrcSpan -> ModuleName -> FindResult -> ErrMsg
- cyclicModuleErr :: [ModSummary] -> SDoc
Perform a dependency analysis starting from the current targets and update the session with the new module graph.
Dependency analysis entails parsing the
import directives and may
therefore require running certain preprocessors.
Note that each
ModSummary in the module graph caches its
DynFlags are determined by the current session
DynFlags and the
LANGUAGE pragmas of the parsed module. Thus if you want to
changes to the
DynFlags to take effect you need to call this function
Try to load the program. See
LoadHowMuch for the different modes.
This function implements the core of GHC's
--make mode. It preprocesses,
compiles and loads the specified modules, avoiding re-compilation wherever
possible. Depending on the target (see
and loading may result in files being created on disk.
reportModuleCompilationResult callback after each compiling
each module, whether successful or not.
SourceError if errors are encountered before the actual
compilation starts (e.g., during dependency analysis). All other errors
are reported using the callback.
Describes which modules of the module graph need to be loaded.
Drop hi-boot nodes? (see below)
|-> Maybe ModuleName|
Root module name. If
|-> [SCC ModSummary]|
Topological sort of the module graph
Calculate SCCs of the module graph, possibly dropping the hi-boot nodes The resulting list of strongly-connected-components is in topologically sorted order, starting with the module(s) at the bottom of the dependency graph (ie compile them first) and ending with the ones at the top.
Drop hi-boot nodes (first boolean arg)?
False: treat the hi-boot summaries as nodes of the graph, so the graph must be acyclic
True: eliminate the hi-boot nodes, and instead pretend the a source-import of Foo is an import of Foo The resulting graph has no hi-boot nodes, but can be cyclic