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 :: [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

View File

@ -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

View File

@ -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