hie-bios-0.6.2: Set up a GHC API session
Safe HaskellNone
LanguageHaskell2010

HIE.Bios.Ghc.Load

Description

Convenience functions for loading a file into a GHC API session

Synopsis

Documentation

loadFileWithMessage Source #

Arguments

:: GhcMonad m 
=> Maybe Messager

Optional messager hook to log messages produced by GHC.

-> (FilePath, FilePath)

Target file to load.

-> m (Maybe TypecheckedModule, [TypecheckedModule])

Typechecked module and modules that had to be loaded for the target.

Load a target into the GHC session.

The target is represented as a tuple. The tuple consists of the original filename and another file that contains the actual source code to compile.

The optional messager can be used to log diagnostics, warnings or errors that occurred during loading the target.

If the loading succeeds, the typechecked module is returned together with all the typechecked modules that had to be loaded in order to typecheck the given target.

loadFile Source #

Arguments

:: GhcMonad m 
=> (FilePath, FilePath)

Target file to load.

-> m (Maybe TypecheckedModule, [TypecheckedModule])

Typechecked module and modules that had to be loaded for the target.

Load a target into the GHC session with the default messager which outputs updates in the same format as normal GHC.

The target is represented as a tuple. The tuple consists of the original filename and another file that contains the actual source code to compile.

If the message should configured, use loadFileWithMessage.

If the loading succeeds, the typechecked module is returned together with all the typechecked modules that had to be loaded in order to typecheck the given target.

setTargetFiles :: GhcMonad m => [(FilePath, FilePath)] -> m () Source #

Set the files as targets and load them. This will reset GHC's targets so only the modules you set as targets and its dependencies will be loaded or reloaded. Produced diagnostics will be printed similar to the normal output of GHC. To configure this, use setTargetFilesWithMessage.

setTargetFilesWithMessage :: GhcMonad m => Maybe Messager -> [(FilePath, FilePath)] -> m () Source #

Set the files as targets and load them. This will reset GHC's targets so only the modules you set as targets and its dependencies will be loaded or reloaded.