hsdev-0.3.3.0: Haskell development library

Safe HaskellNone
LanguageHaskell98

HsDev.Tools.Ghc.Base

Contents

Synopsis

Running Ghc

ghcRun :: GhcMonad m => [String] -> m a -> m a Source #

Run ghc

ghcRunWith :: GhcMonad m => (DynFlags -> DynFlags) -> [String] -> m a -> m a Source #

Run ghc

Commonly used DynFlags

Setting DynFlags

withFlags :: GhcMonad m => m a -> m a Source #

Alter DynFlags temporary

modifyFlags :: GhcMonad m => (DynFlags -> DynFlags) -> m () Source #

Update DynFlags

Loading targets

clearTargets :: GhcMonad m => m () Source #

Clear loaded targets

makeTarget :: GhcMonad m => Text -> Maybe Text -> m Target Source #

Make target with its source code optional

loadTargets :: GhcMonad m => [Target] -> m () Source #

Load all targets

loadInteractive :: GhcMonad m => Path -> Maybe Text -> m () Source #

Load and set interactive context

reload :: GhcMonad m => m () Source #

Reload targets

Logging messages

collectMessages :: GhcMonad m => m a -> m (a, [Note OutputMessage]) Source #

Collect messages from ghc for underlying computation

collectMessages_ :: GhcMonad m => m () -> m [Note OutputMessage] Source #

Same as collectMessages, but when no result except notes needed

Util

formatType :: DynFlags -> Type -> String Source #

Format type for output

spanRegion :: SrcSpan -> Region Source #

Get region of SrcSpan

withCurrentDirectory :: GhcMonad m => FilePath -> m a -> m a Source #

Set current directory and restore it after action

logToChan :: Chan (Note OutputMessage) -> LogAction Source #

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

logToNull :: LogAction Source #

Don't log ghc warnings and errors