From f413cda0fea000746ccac7c2fd95f8750c4d212b Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 28 Apr 2014 11:26:06 +0900 Subject: [PATCH] one more try. --- Language/Haskell/GhcMod/Gap.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs index f97eafe..aeda11c 100644 --- a/Language/Haskell/GhcMod/Gap.hs +++ b/Language/Haskell/GhcMod/Gap.hs @@ -204,7 +204,12 @@ withContext action = gbracket setup teardown body action topImports = do mss <- getModuleGraph - map modName <$> filterM isTop mss + ms <- map modName <$> filterM isTop mss +#if __GLASGOW_HASKELL__ >= 704 + return ms +#else + return (ms,[]) +#endif isTop mos = lookupMod mos ||> returnFalse lookupMod mos = lookupModule (ms_mod_name mos) Nothing >> return True returnFalse = return False @@ -216,7 +221,7 @@ withContext action = gbracket setup teardown body setCtx = setContext #else modName = ms_mod - setCtx = flip setContext [] + setCtx = uncurry setContext #endif showSeverityCaption :: Severity -> String