From 6cad3e8c495cb6b6630c6962a5e8c6673d095a2b Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 27 Oct 2010 11:09:44 +0000 Subject: follow changes in the GHC API --- src/Haddock/Interface/AttachInstances.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Haddock/Interface/AttachInstances.hs') 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 -------------------------------------------------------------------------------- -- cgit v1.2.3