ghci-lib- A library for interactively evaluating Haskell code.

Safe HaskellNone




initGhci :: GhcMonad m => m ()Source

Initialize the GHC API. Run this as the first thing in the runGhc.

evalImport :: GhcMonad m => String -> m ()Source

Evaluate a single import statement. If this import statement is importing a module which was previously imported implicitly (such as Prelude) or if this module has a hiding annotation, the previous import is removed.

evalDeclarations :: GhcMonad m => String -> m [String]Source

Evaluate a series of declarations. Return all names which were bound by these declarations.

setFlags :: GhcMonad m => [String] -> m [String]Source

Set a list of flags, as per GHCi's `:set`. This was adapted from GHC's InteractiveUI.hs (newDynFlags). It returns a list of error messages.

getType :: GhcMonad m => String -> m StringSource

Get the type of an expression.