Fix Trac #4302, plus a little refactoring
[ghc-hetmet.git] / compiler / typecheck / FamInst.lhs
index b09f9a5..36f78cb 100644 (file)
@@ -2,13 +2,12 @@ The @FamInst@ type: family instance heads
 
 \begin{code}
 module FamInst ( 
-        checkFamInstConsistency, tcExtendLocalFamInstEnv
+        checkFamInstConsistency, tcExtendLocalFamInstEnv, tcGetFamInstEnvs
     ) where
 
 import HscTypes
 import FamInstEnv
 import TcMType
-import TcType
 import TcRnMonad
 import TyCon
 import Name
@@ -197,4 +196,17 @@ addFamInstLoc famInst thing_inside
   = setSrcSpan (mkSrcSpan loc loc) thing_inside
   where
     loc = getSrcLoc famInst
+\end{code} 
+
+\begin{code} 
+
+tcGetFamInstEnvs :: TcM (FamInstEnv, FamInstEnv)
+-- Gets both the external-package inst-env
+-- and the home-pkg inst env (includes module being compiled)
+tcGetFamInstEnvs 
+  = do { eps <- getEps; env <- getGblEnv
+       ; return (eps_fam_inst_env eps, tcg_fam_inst_env env) 
+       }
+
+
 \end{code}