more applicative.

error msg fix.
This commit is contained in:
Kazu Yamamoto
2012-02-15 14:52:48 +09:00
parent 7474968486
commit 96cbf68e16
6 changed files with 34 additions and 32 deletions

View File

@@ -25,11 +25,9 @@ importDirs :: [String]
importDirs = [".","..","../..","../../..","../../../..","../../../../.."]
initializeGHC :: Options -> FilePath -> [String] -> Bool -> Ghc (FilePath,LogReader)
initializeGHC opt fileName ghcOptions logging =
withCabal `gcatch` withoutCabal
initializeGHC opt fileName ghcOptions logging = withCabal <|> withoutCabal
where
withoutCabal :: SomeException -> Ghc (FilePath,LogReader)
withoutCabal _ = do
withoutCabal = do
logReader <- initSession opt ghcOptions importDirs logging
return (fileName,logReader)
withCabal = do