hsdev-0.1.7.3: Haskell development library and tool with support of autocompletion, symbol info, go to declaration, find references etc.

Safe HaskellNone
LanguageHaskell98

HsDev.Tools.Ghc.Worker

Contents

Synopsis

Workers

ghcWorker :: [String] -> Ghc () -> IO (Worker Ghc) Source

Ghc worker. Pass options and initializer action

ghciWorker :: IO (Worker Ghc) Source

Interpreter worker is worker with preludeModules loaded

Initializers and actions

ghcRun :: [String] -> Ghc a -> Ghc a Source

Run ghc

withFlags :: Ghc a -> Ghc a Source

Alter DynFlags temporary

modifyFlags :: (DynFlags -> DynFlags) -> Ghc () Source

Update DynFlags

addCmdOpts :: [String] -> Ghc () Source

Add options without reinit session

setCmdOpts :: [String] -> Ghc () Source

Set options after session reinit

importModules :: [String] -> Ghc () Source

Import some modules

preludeModules :: [String] Source

Default interpreter modules

evaluate :: String -> Ghc String Source

Evaluate expression

clearTargets :: Ghc () Source

Clear loaded targets

makeTarget :: String -> Maybe String -> Ghc Target Source

Make target with its source code optional

loadTargets :: [Target] -> Ghc () Source

Load all targets

Utils

listPackages :: Ghc [ModulePackage] Source

Get list of installed packages

spanRegion :: SrcSpan -> Region Source

Get region of SrcSpan

withCurrentDirectory :: FilePath -> Ghc a -> Ghc a Source

Set current directory and restore it after action

logToChan :: Chan (Note OutputMessage) -> DynFlags -> Severity -> SrcSpan -> PprStyle -> SDoc -> IO () Source

Log ghc warnings and errors as to chan You may have to apply recalcTabs on result notes

logToNull :: DynFlags -> Severity -> SrcSpan -> PprStyle -> SDoc -> IO () Source

Don't log ghc warnings and errors

data Ghc a :: * -> *

A minimal implementation of a GhcMonad. If you need a custom monad, e.g., to maintain additional state consider wrapping this monad or using GhcT.