removing unnecessary return value.
This commit is contained in:
parent
7761691795
commit
d01cfac221
6
Cabal.hs
6
Cabal.hs
@ -23,16 +23,16 @@ import Types
|
|||||||
importDirs :: [String]
|
importDirs :: [String]
|
||||||
importDirs = [".","..","../..","../../..","../../../..","../../../../.."]
|
importDirs = [".","..","../..","../../..","../../../..","../../../../.."]
|
||||||
|
|
||||||
initializeGHC :: Options -> FilePath -> [String] -> Bool -> Ghc (FilePath,LogReader)
|
initializeGHC :: Options -> FilePath -> [String] -> Bool -> Ghc LogReader
|
||||||
initializeGHC opt fileName ghcOptions logging = withCabal ||> withoutCabal
|
initializeGHC opt fileName ghcOptions logging = withCabal ||> withoutCabal
|
||||||
where
|
where
|
||||||
withoutCabal = do
|
withoutCabal = do
|
||||||
logReader <- initSession opt ghcOptions importDirs Nothing logging
|
logReader <- initSession opt ghcOptions importDirs Nothing logging
|
||||||
return (fileName,logReader)
|
return logReader
|
||||||
withCabal = do
|
withCabal = do
|
||||||
(gopts,idirs,depPkgs) <- liftIO $ fromCabal ghcOptions
|
(gopts,idirs,depPkgs) <- liftIO $ fromCabal ghcOptions
|
||||||
logReader <- initSession opt gopts idirs (Just depPkgs) logging
|
logReader <- initSession opt gopts idirs (Just depPkgs) logging
|
||||||
return (fileName,logReader)
|
return logReader
|
||||||
|
|
||||||
fromCabal :: [String] -> IO ([String], [FilePath], [String])
|
fromCabal :: [String] -> IO ([String], [FilePath], [String])
|
||||||
fromCabal ghcOptions = do
|
fromCabal ghcOptions = do
|
||||||
|
4
Check.hs
4
Check.hs
@ -21,8 +21,8 @@ check :: Options -> String -> IO [String]
|
|||||||
check opt fileName = withGHC' fileName $ checkIt `gcatch` handleErrMsg
|
check opt fileName = withGHC' fileName $ checkIt `gcatch` handleErrMsg
|
||||||
where
|
where
|
||||||
checkIt = do
|
checkIt = do
|
||||||
(file,readLog) <- initializeGHC opt fileName options True
|
readLog <- initializeGHC opt fileName options True
|
||||||
setTargetFile file
|
setTargetFile fileName
|
||||||
_ <- load LoadAllTargets
|
_ <- load LoadAllTargets
|
||||||
liftIO readLog
|
liftIO readLog
|
||||||
options
|
options
|
||||||
|
4
Info.hs
4
Info.hs
@ -143,8 +143,8 @@ inModuleContext opt fileName modstr action errmsg =
|
|||||||
withGHC (valid ||> invalid ||> return errmsg)
|
withGHC (valid ||> invalid ||> return errmsg)
|
||||||
where
|
where
|
||||||
valid = do
|
valid = do
|
||||||
(file,_) <- initializeGHC opt fileName ["-w"] False
|
_ <- initializeGHC opt fileName ["-w"] False
|
||||||
setTargetFile file
|
setTargetFile fileName
|
||||||
_ <- load LoadAllTargets
|
_ <- load LoadAllTargets
|
||||||
doif setContextFromTarget action
|
doif setContextFromTarget action
|
||||||
invalid = do
|
invalid = do
|
||||||
|
Loading…
Reference in New Issue
Block a user