removing unnecessary return value.

This commit is contained in:
Kazu Yamamoto 2013-03-01 16:42:22 +09:00
parent 7761691795
commit d01cfac221
3 changed files with 7 additions and 7 deletions

View File

@ -23,16 +23,16 @@ import Types
importDirs :: [String]
importDirs = [".","..","../..","../../..","../../../..","../../../../.."]
initializeGHC :: Options -> FilePath -> [String] -> Bool -> Ghc (FilePath,LogReader)
initializeGHC :: Options -> FilePath -> [String] -> Bool -> Ghc LogReader
initializeGHC opt fileName ghcOptions logging = withCabal ||> withoutCabal
where
withoutCabal = do
logReader <- initSession opt ghcOptions importDirs Nothing logging
return (fileName,logReader)
return logReader
withCabal = do
(gopts,idirs,depPkgs) <- liftIO $ fromCabal ghcOptions
logReader <- initSession opt gopts idirs (Just depPkgs) logging
return (fileName,logReader)
return logReader
fromCabal :: [String] -> IO ([String], [FilePath], [String])
fromCabal ghcOptions = do

View File

@ -21,8 +21,8 @@ check :: Options -> String -> IO [String]
check opt fileName = withGHC' fileName $ checkIt `gcatch` handleErrMsg
where
checkIt = do
(file,readLog) <- initializeGHC opt fileName options True
setTargetFile file
readLog <- initializeGHC opt fileName options True
setTargetFile fileName
_ <- load LoadAllTargets
liftIO readLog
options

View File

@ -143,8 +143,8 @@ inModuleContext opt fileName modstr action errmsg =
withGHC (valid ||> invalid ||> return errmsg)
where
valid = do
(file,_) <- initializeGHC opt fileName ["-w"] False
setTargetFile file
_ <- initializeGHC opt fileName ["-w"] False
setTargetFile fileName
_ <- load LoadAllTargets
doif setContextFromTarget action
invalid = do