rescue old GHCs.
This commit is contained in:
parent
017d4cc22f
commit
2733f94a52
@ -200,23 +200,24 @@ withContext action = gbracket setup teardown body
|
|||||||
setup = getContext
|
setup = getContext
|
||||||
teardown = setContext
|
teardown = setContext
|
||||||
body _ = do
|
body _ = do
|
||||||
topImports >>= setContext
|
topImports >>= setCtx
|
||||||
action
|
action
|
||||||
topImports = do
|
topImports = do
|
||||||
mss <- getModuleGraph
|
mss <- getModuleGraph
|
||||||
#if __GLASGOW_HASKELL__ >= 706
|
|
||||||
let modName = IIModule . moduleName . ms_mod
|
|
||||||
#elif __GLASGOW_HASKELL__ >= 704
|
|
||||||
let modName = IIModule . ms_mod
|
|
||||||
#else
|
|
||||||
let modName = ms_mod
|
|
||||||
#endif
|
|
||||||
map modName <$> filterM isTop mss
|
map modName <$> filterM isTop mss
|
||||||
where
|
isTop mos = lookupMod mos ||> returnFalse
|
||||||
isTop mos = lookupMod ||> returnFalse
|
lookupMod mos = lookupModule (ms_mod_name mos) Nothing >> return True
|
||||||
where
|
returnFalse = return False
|
||||||
lookupMod = lookupModule (ms_mod_name mos) Nothing >> return True
|
#if __GLASGOW_HASKELL__ >= 706
|
||||||
returnFalse = return False
|
modName = IIModule . moduleName . ms_mod
|
||||||
|
setCtx = setContext
|
||||||
|
#elif __GLASGOW_HASKELL__ >= 704
|
||||||
|
modName = IIModule . ms_mod
|
||||||
|
setCtx = setContext
|
||||||
|
#else
|
||||||
|
modName = ms_mod
|
||||||
|
setCtx = flip setContext []
|
||||||
|
#endif
|
||||||
|
|
||||||
showSeverityCaption :: Severity -> String
|
showSeverityCaption :: Severity -> String
|
||||||
#if __GLASGOW_HASKELL__ >= 706
|
#if __GLASGOW_HASKELL__ >= 706
|
||||||
|
Loading…
Reference in New Issue
Block a user