--- hint-0.3.3.1-orig/src/Hint/GHC.hs 2010-11-08 23:25:46.000000000 +1100 +++ hint-0.3.3.1/src/Hint/GHC.hs 2010-12-21 22:27:01.609087105 +1100 @@ -40,7 +40,11 @@ import StringBuffer ( stringToStringBuffer ) import Lexer ( P(..), ParseResult(..), mkPState ) import Parser ( parseStmt, parseType ) +#if __GLASGOW_HASKELL__ >= 700 +import DynFlags ( supportedLanguagesAndExtensions ) +#else import DynFlags ( supportedLanguages ) +#endif #if __GLASGOW_HASKELL__ >= 608 import PprTyThing ( pprTypeForUser ) --- hint-0.3.3.1-orig/src/Hint/Configuration.hs 2010-11-08 23:25:46.000000000 +1100 +++ hint-0.3.3.1/src/Hint/Configuration.hs 2010-12-21 23:36:05.831393804 +1100 @@ -89,7 +89,11 @@ -- | List of the extensions known by the interpreter. availableExtensions :: [Extension] +#if __GLASGOW_HASKELL__ >= 700 +availableExtensions = asExtensionList GHC.supportedLanguagesAndExtensions +#else availableExtensions = asExtensionList GHC.supportedLanguages +#endif asExtensionList :: [String] -> [Extension] asExtensionList exts = map read knownPos ++ --- hint-0.3.3.1-orig/src/Hint/Context.hs 2010-11-08 23:25:46.000000000 +1100 +++ hint-0.3.3.1/src/Hint/Context.hs 2010-12-22 14:37:06.577060005 +1100 @@ -58,8 +58,13 @@ allModulesInContext :: MonadInterpreter m => m ([ModuleName], [ModuleName]) allModulesInContext = +#if __GLASGOW_HASKELL__ >= 700 + do (l, i) <- runGhc (liftM (\(x, y) -> (x, map fst y)) GHC.getContext) + return (map fromGhcRep_ l, map fromGhcRep_ i) +#else do (l, i) <- runGhc GHC.getContext return (map fromGhcRep_ l, map fromGhcRep_ i) +#endif addPhantomModule :: MonadInterpreter m => (ModuleName -> ModuleText) @@ -249,7 +254,11 @@ pm <- maybe (return []) (findModule . pm_name >=> return . return) new_pm (old_top_level, _) <- runGhc GHC.getContext let new_top_level = pm ++ old_top_level +#if __GLASGOW_HASKELL__ >= 700 + runGhc2 GHC.setContext new_top_level (map (\x -> (x, Nothing)) unqual_mods) +#else runGhc2 GHC.setContext new_top_level unqual_mods +#endif -- onState (\s ->s{qual_imports = quals}) --- hint-0.3.3.1-orig/src/Hint/Parsers.hs 2010-11-08 23:25:46.000000000 +1100 +++ hint-0.3.3.1/src/Hint/Parsers.hs 2010-12-22 14:57:53.708935442 +1100 @@ -24,7 +24,11 @@ -- buf <- liftIO $ GHC.stringToStringBuffer expr -- +#if __GLASGOW_HASKELL__ >= 700 + let parse_res = GHC.unP parser (GHC.mkPState dyn_fl buf GHC.noSrcLoc) +#else let parse_res = GHC.unP parser (GHC.mkPState buf GHC.noSrcLoc dyn_fl) +#endif -- case parse_res of GHC.POk{} -> return ParseOk