removing the third argument from initializeFlagsWithCradle.
This commit is contained in:
parent
117d01a52a
commit
000076223f
@ -32,7 +32,7 @@ browseModule :: Options
|
|||||||
-> ModuleString -- ^ A module name. (e.g. \"Data.List\")
|
-> ModuleString -- ^ A module name. (e.g. \"Data.List\")
|
||||||
-> IO String
|
-> IO String
|
||||||
browseModule opt cradle pkgmdl = withGHC' $ do
|
browseModule opt cradle pkgmdl = withGHC' $ do
|
||||||
initializeFlagsWithCradle opt cradle []
|
initializeFlagsWithCradle opt cradle
|
||||||
browse opt pkgmdl
|
browse opt pkgmdl
|
||||||
|
|
||||||
-- | Getting functions, classes, etc from a module.
|
-- | Getting functions, classes, etc from a module.
|
||||||
|
@ -22,7 +22,7 @@ checkSyntax :: Options
|
|||||||
-> IO String
|
-> IO String
|
||||||
checkSyntax _ _ [] = return ""
|
checkSyntax _ _ [] = return ""
|
||||||
checkSyntax opt cradle files = withGHC sessionName $ do
|
checkSyntax opt cradle files = withGHC sessionName $ do
|
||||||
initializeFlagsWithCradle opt cradle (ghcOpts opt)
|
initializeFlagsWithCradle opt cradle
|
||||||
check opt files
|
check opt files
|
||||||
where
|
where
|
||||||
sessionName = case files of
|
sessionName = case files of
|
||||||
@ -48,7 +48,7 @@ expandTemplate :: Options
|
|||||||
-> IO String
|
-> IO String
|
||||||
expandTemplate _ _ [] = return ""
|
expandTemplate _ _ [] = return ""
|
||||||
expandTemplate opt cradle files = withGHC sessionName $ do
|
expandTemplate opt cradle files = withGHC sessionName $ do
|
||||||
initializeFlagsWithCradle opt cradle (ghcOpts opt)
|
initializeFlagsWithCradle opt cradle
|
||||||
expand opt files
|
expand opt files
|
||||||
where
|
where
|
||||||
sessionName = case files of
|
sessionName = case files of
|
||||||
|
@ -33,7 +33,7 @@ newtype SymMdlDb = SymMdlDb (Map Symbol [ModuleString])
|
|||||||
-- | Find modules to which the symbol belong.
|
-- | Find modules to which the symbol belong.
|
||||||
findSymbol :: Options -> Cradle -> Symbol -> IO String
|
findSymbol :: Options -> Cradle -> Symbol -> IO String
|
||||||
findSymbol opt cradle sym = withGHC' $ do
|
findSymbol opt cradle sym = withGHC' $ do
|
||||||
initializeFlagsWithCradle opt cradle []
|
initializeFlagsWithCradle opt cradle
|
||||||
lookupSym opt sym <$> getSymMdlDb
|
lookupSym opt sym <$> getSymMdlDb
|
||||||
|
|
||||||
-- | Creating 'SymMdlDb'.
|
-- | Creating 'SymMdlDb'.
|
||||||
|
@ -76,14 +76,14 @@ data Build = CabalPkg | SingleFile deriving Eq
|
|||||||
initializeFlagsWithCradle :: GhcMonad m
|
initializeFlagsWithCradle :: GhcMonad m
|
||||||
=> Options
|
=> Options
|
||||||
-> Cradle
|
-> Cradle
|
||||||
-> [GHCOption]
|
|
||||||
-> m ()
|
-> m ()
|
||||||
initializeFlagsWithCradle opt cradle ghcopts
|
initializeFlagsWithCradle opt cradle
|
||||||
| cabal = withCabal |||> withSandbox
|
| cabal = withCabal |||> withSandbox
|
||||||
| otherwise = withSandbox
|
| otherwise = withSandbox
|
||||||
where
|
where
|
||||||
mCradleFile = cradleCabalFile cradle
|
mCradleFile = cradleCabalFile cradle
|
||||||
cabal = isJust mCradleFile
|
cabal = isJust mCradleFile
|
||||||
|
ghcopts = ghcOpts opt
|
||||||
withCabal = do
|
withCabal = do
|
||||||
pkgDesc <- liftIO $ parseCabalFile $ fromJust mCradleFile
|
pkgDesc <- liftIO $ parseCabalFile $ fromJust mCradleFile
|
||||||
compOpts <- liftIO $ getCompilerOptions ghcopts cradle pkgDesc
|
compOpts <- liftIO $ getCompilerOptions ghcopts cradle pkgDesc
|
||||||
|
@ -37,7 +37,7 @@ infoExpr :: Options
|
|||||||
-> Expression -- ^ A Haskell expression.
|
-> Expression -- ^ A Haskell expression.
|
||||||
-> IO String
|
-> IO String
|
||||||
infoExpr opt cradle file expr = withGHC' $ do
|
infoExpr opt cradle file expr = withGHC' $ do
|
||||||
initializeFlagsWithCradle opt cradle []
|
initializeFlagsWithCradle opt cradle
|
||||||
info opt file expr
|
info opt file expr
|
||||||
|
|
||||||
-- | Obtaining information of a target expression. (GHCi's info:)
|
-- | Obtaining information of a target expression. (GHCi's info:)
|
||||||
@ -73,7 +73,7 @@ typeExpr :: Options
|
|||||||
-> Int -- ^ Column number.
|
-> Int -- ^ Column number.
|
||||||
-> IO String
|
-> IO String
|
||||||
typeExpr opt cradle file lineNo colNo = withGHC' $ do
|
typeExpr opt cradle file lineNo colNo = withGHC' $ do
|
||||||
initializeFlagsWithCradle opt cradle []
|
initializeFlagsWithCradle opt cradle
|
||||||
types opt file lineNo colNo
|
types opt file lineNo colNo
|
||||||
|
|
||||||
-- | Obtaining type of a target expression. (GHCi's type:)
|
-- | Obtaining type of a target expression. (GHCi's type:)
|
||||||
|
@ -15,7 +15,7 @@ import UniqFM (eltsUFM)
|
|||||||
-- | Listing installed modules.
|
-- | Listing installed modules.
|
||||||
listModules :: Options -> Cradle -> IO String
|
listModules :: Options -> Cradle -> IO String
|
||||||
listModules opt cradle = withGHC' $ do
|
listModules opt cradle = withGHC' $ do
|
||||||
initializeFlagsWithCradle opt cradle []
|
initializeFlagsWithCradle opt cradle
|
||||||
modules opt
|
modules opt
|
||||||
|
|
||||||
-- | Listing installed modules.
|
-- | Listing installed modules.
|
||||||
|
@ -122,7 +122,7 @@ replace (x:xs) = x : replace xs
|
|||||||
|
|
||||||
run :: Cradle -> Maybe FilePath -> Options -> Ghc a -> IO a
|
run :: Cradle -> Maybe FilePath -> Options -> Ghc a -> IO a
|
||||||
run cradle mlibdir opt body = G.runGhc mlibdir $ do
|
run cradle mlibdir opt body = G.runGhc mlibdir $ do
|
||||||
initializeFlagsWithCradle opt cradle []
|
initializeFlagsWithCradle opt cradle
|
||||||
dflags <- G.getSessionDynFlags
|
dflags <- G.getSessionDynFlags
|
||||||
G.defaultCleanupHandler dflags body
|
G.defaultCleanupHandler dflags body
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user