Index: ubuntu/utils/haddock/src/Haddock/Interface/AttachInstances.hs
===================================================================
--- ubuntu.orig/utils/haddock/src/Haddock/Interface/AttachInstances.hs	2011-01-13 10:50:13.280644561 +0000
+++ ubuntu/utils/haddock/src/Haddock/Interface/AttachInstances.hs	2011-01-13 10:50:16.800918517 +0000
@@ -25,7 +25,9 @@
 import InstEnv
 import Class
 import HscTypes (withSession, ioMsg)
+#ifdef GHCI
 import TcRnDriver (tcRnGetInfo)
+#endif
 
 #if __GLASGOW_HASKELL__ > 610 || (__GLASGOW_HASKELL__ == 610 && __GHC_PATCHLEVEL__ >= 2)
 import TypeRep hiding (funTyConName)
@@ -48,7 +50,11 @@
       return $ iface { ifaceExportItems = newItems }
 
     attachExport export@ExportDecl{expItemDecl = L _ (TyClD d)} = do
+#ifdef GHCI
        mb_info <- getAllInfo (unLoc (tcdLName d))
+#else
+       let mb_info = Nothing
+#endif
        return $ export { expItemInstances = case mb_info of
          Just (_, _, instances) ->
            map synifyInstHead . sortImage instHead . map instanceHead $ instances
@@ -58,10 +64,12 @@
     attachExport export = return export
 
 
+#ifdef GHCI
 -- | 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
+#endif
 
 --------------------------------------------------------------------------------
 -- Collecting and sorting instances
Index: ubuntu/utils/haddock/src/Haddock/Interface/Create.hs
===================================================================
--- ubuntu.orig/utils/haddock/src/Haddock/Interface/Create.hs	2011-01-13 10:50:13.260643003 +0000
+++ ubuntu/utils/haddock/src/Haddock/Interface/Create.hs	2011-01-13 10:50:16.800918517 +0000
@@ -495,7 +495,11 @@
         Nothing -> do
           -- If we can't find the declaration, it must belong to
           -- another package
+#ifdef GHCI
           mbTyThing <- liftGhcToErrMsgGhc $ lookupName t
+#else
+          mbTyThing <- liftGhcToErrMsgGhc $ lookupGlobalName t
+#endif
           -- show the name as exported as well as the name's
           -- defining module (because the latter is where we
           -- looked for the .hi/.haddock).  It's to help people
