doc.
This commit is contained in:
parent
913fb72911
commit
a1aa44bdbb
@ -152,7 +152,7 @@ addCmdOpts cmdOpts df =
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
-- | Set the files and load
|
||||
-- | Set the files as targets and load them.
|
||||
setTargetFiles :: (GhcMonad m) => [FilePath] -> m ()
|
||||
setTargetFiles files = do
|
||||
targets <- forM files $ \file -> G.guessTarget file Nothing
|
||||
@ -178,9 +178,11 @@ withDynFlags setFlag body = G.gbracket setup teardown (\_ -> body)
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
-- | Set 'DynFlags' equivalent to "-w:".
|
||||
setNoWaringFlags :: DynFlags -> DynFlags
|
||||
setNoWaringFlags df = df { warningFlags = Gap.emptyWarnFlags}
|
||||
|
||||
-- | Set 'DynFlags' equivalent to "-Wall".
|
||||
setAllWaringFlags :: DynFlags -> DynFlags
|
||||
setAllWaringFlags df = df { warningFlags = allWarningFlags }
|
||||
|
||||
|
@ -44,6 +44,9 @@ appendLogRef df (LogRef ref) _ sev src style msg = do
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
-- | Set the session flag (e.g. "-Wall" or "-w:") then
|
||||
-- executes a body. Log messages are returned as 'String'.
|
||||
-- Right is success and Left is failure.
|
||||
withLogger :: Options -> (DynFlags -> DynFlags) -> Ghc () -> Ghc (Either String String)
|
||||
withLogger opt setDF body = ghandle (handleErrMsg opt) $ do
|
||||
logref <- liftIO $ newLogRef
|
||||
|
Loading…
Reference in New Issue
Block a user