diff options
author | Simon Marlow <marlowsd@gmail.com> | 2010-10-27 11:09:44 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2010-10-27 11:09:44 +0000 |
commit | 6cad3e8c495cb6b6630c6962a5e8c6673d095a2b (patch) | |
tree | 80a0e149ad971af050dcf3778e8ed83729d9b182 | |
parent | 985c84aa4fe1422d211254c1a484c66f12a87a9e (diff) |
follow changes in the GHC API
-rw-r--r-- | src/Haddock/GhcUtils.hs | 5 | ||||
-rw-r--r-- | src/Haddock/Interface/AttachInstances.hs | 11 | ||||
-rw-r--r-- | src/Haddock/InterfaceFile.hs | 3 | ||||
-rw-r--r-- | src/Haddock/Lex.x | 4 |
4 files changed, 20 insertions, 3 deletions
diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index fdc9a5c3..9c5090af 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -29,8 +29,11 @@ import Name import Packages import Module import RdrName (GlobalRdrEnv) +#if MIN_VERSION_ghc(7,1,0) +import GhcMonad (withSession) +#endif import HscTypes -#if __GLASGOW_HASKELL__ >= 613 +#if MIN_VERSION_ghc(6,13,0) import UniqFM #else import LazyUniqFM diff --git a/src/Haddock/Interface/AttachInstances.hs b/src/Haddock/Interface/AttachInstances.hs index fd1e86d9..cc2dfa19 100644 --- a/src/Haddock/Interface/AttachInstances.hs +++ b/src/Haddock/Interface/AttachInstances.hs @@ -25,7 +25,12 @@ import GHC import Name import InstEnv import Class -import HscTypes (withSession, ioMsg) +#if MIN_VERSION_ghc(7,1,0) +import GhcMonad (withSession) +#else +import HscTypes (withSession) +#endif +import MonadUtils (liftIO) import TcRnDriver (tcRnGetInfo) import TypeRep hiding (funTyConName) import Var hiding (varName) @@ -93,7 +98,9 @@ lookupInstDoc name iface ifaceMap instIfaceMap = -- | Like GHC's getInfo but doesn't cut things out depending on the -- interative context, which we don't set sufficiently anyway. getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[Instance])) -getAllInfo name = withSession $ \hsc_env -> ioMsg $ tcRnGetInfo hsc_env name +getAllInfo name = withSession $ \hsc_env -> do + (_msgs, r) <- liftIO $ tcRnGetInfo hsc_env name + return r -------------------------------------------------------------------------------- diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 57b5627a..f66f862f 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -35,6 +35,9 @@ import UniqSupply import UniqFM import IfaceEnv import HscTypes +#if MIN_VERSION_ghc(7,1,0) +import GhcMonad (withSession) +#endif import FastMutInt import FastString import Unique diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x index 4f877fc9..75d44fff 100644 --- a/src/Haddock/Lex.x +++ b/src/Haddock/Lex.x @@ -184,7 +184,11 @@ ident pos str sc cont dflags = strToHsQNames :: DynFlags -> String -> Maybe [RdrName] strToHsQNames dflags str0 = +#if MIN_VERSION_ghc(7,1,0) + let buffer = stringToStringBuffer str0 +#else let buffer = unsafePerformIO (stringToStringBuffer str0) +#endif #if MIN_VERSION_ghc(6,13,0) pstate = mkPState dflags buffer noSrcLoc #else |