Merge pull request #34 from thoughtpolice/ghc-7.4

Add support for GHC 7.4.1
This commit is contained in:
Kazu Yamamoto 2011-12-25 23:15:58 -08:00
commit e4d47de1f8

View File

@ -107,9 +107,15 @@ inModuleContext opt fileName modstr action = withGHC valid
setContextFromTarget :: Ghc Bool
setContextFromTarget = do
ms <- depanal [] False
#if __GLASGOW_HASKELL__ >= 704
top <- map (IIModule . ms_mod) <$> filterM isTop ms
setContext top
#else
top <- map ms_mod <$> filterM isTop ms
setContext top []
return (top /= [])
#endif
return (not . null $ top)
where
isTop ms = lookupMod `gcatch` returnFalse
where