removing the third argument from initializeFlagsWithCradle.

This commit is contained in:
Kazu Yamamoto 2014-04-28 13:00:25 +09:00
parent 117d01a52a
commit 000076223f
7 changed files with 10 additions and 10 deletions

View File

@ -32,7 +32,7 @@ browseModule :: Options
-> ModuleString -- ^ A module name. (e.g. \"Data.List\")
-> IO String
browseModule opt cradle pkgmdl = withGHC' $ do
initializeFlagsWithCradle opt cradle []
initializeFlagsWithCradle opt cradle
browse opt pkgmdl
-- | Getting functions, classes, etc from a module.

View File

@ -22,7 +22,7 @@ checkSyntax :: Options
-> IO String
checkSyntax _ _ [] = return ""
checkSyntax opt cradle files = withGHC sessionName $ do
initializeFlagsWithCradle opt cradle (ghcOpts opt)
initializeFlagsWithCradle opt cradle
check opt files
where
sessionName = case files of
@ -48,7 +48,7 @@ expandTemplate :: Options
-> IO String
expandTemplate _ _ [] = return ""
expandTemplate opt cradle files = withGHC sessionName $ do
initializeFlagsWithCradle opt cradle (ghcOpts opt)
initializeFlagsWithCradle opt cradle
expand opt files
where
sessionName = case files of

View File

@ -33,7 +33,7 @@ newtype SymMdlDb = SymMdlDb (Map Symbol [ModuleString])
-- | Find modules to which the symbol belong.
findSymbol :: Options -> Cradle -> Symbol -> IO String
findSymbol opt cradle sym = withGHC' $ do
initializeFlagsWithCradle opt cradle []
initializeFlagsWithCradle opt cradle
lookupSym opt sym <$> getSymMdlDb
-- | Creating 'SymMdlDb'.

View File

@ -76,14 +76,14 @@ data Build = CabalPkg | SingleFile deriving Eq
initializeFlagsWithCradle :: GhcMonad m
=> Options
-> Cradle
-> [GHCOption]
-> m ()
initializeFlagsWithCradle opt cradle ghcopts
initializeFlagsWithCradle opt cradle
| cabal = withCabal |||> withSandbox
| otherwise = withSandbox
where
mCradleFile = cradleCabalFile cradle
cabal = isJust mCradleFile
ghcopts = ghcOpts opt
withCabal = do
pkgDesc <- liftIO $ parseCabalFile $ fromJust mCradleFile
compOpts <- liftIO $ getCompilerOptions ghcopts cradle pkgDesc

View File

@ -37,7 +37,7 @@ infoExpr :: Options
-> Expression -- ^ A Haskell expression.
-> IO String
infoExpr opt cradle file expr = withGHC' $ do
initializeFlagsWithCradle opt cradle []
initializeFlagsWithCradle opt cradle
info opt file expr
-- | Obtaining information of a target expression. (GHCi's info:)
@ -73,7 +73,7 @@ typeExpr :: Options
-> Int -- ^ Column number.
-> IO String
typeExpr opt cradle file lineNo colNo = withGHC' $ do
initializeFlagsWithCradle opt cradle []
initializeFlagsWithCradle opt cradle
types opt file lineNo colNo
-- | Obtaining type of a target expression. (GHCi's type:)

View File

@ -15,7 +15,7 @@ import UniqFM (eltsUFM)
-- | Listing installed modules.
listModules :: Options -> Cradle -> IO String
listModules opt cradle = withGHC' $ do
initializeFlagsWithCradle opt cradle []
initializeFlagsWithCradle opt cradle
modules opt
-- | Listing installed modules.

View File

@ -122,7 +122,7 @@ replace (x:xs) = x : replace xs
run :: Cradle -> Maybe FilePath -> Options -> Ghc a -> IO a
run cradle mlibdir opt body = G.runGhc mlibdir $ do
initializeFlagsWithCradle opt cradle []
initializeFlagsWithCradle opt cradle
dflags <- G.getSessionDynFlags
G.defaultCleanupHandler dflags body