X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FFamInst.lhs;h=e2da7952a92291d4cd6d8e1f7faa7a6650b218e3;hp=609c0ba0089fc466b53a8df41805530c64d69a17;hb=d2ce0f52d42edf32bb9f13796e6ba6edba8bd516;hpb=8897e76874e10daa4dc695342e68b15e114a6de0 diff --git a/compiler/typecheck/FamInst.lhs b/compiler/typecheck/FamInst.lhs index 609c0ba..e2da795 100644 --- a/compiler/typecheck/FamInst.lhs +++ b/compiler/typecheck/FamInst.lhs @@ -2,7 +2,7 @@ The @FamInst@ type: family instance heads \begin{code} module FamInst ( - checkFamInstConsistency, tcExtendLocalFamInstEnv + checkFamInstConsistency, tcExtendLocalFamInstEnv, tcGetFamInstEnvs ) where import HscTypes @@ -15,12 +15,12 @@ import Name import Module import SrcLoc import Outputable -import LazyUniqFM +import UniqFM import FiniteMap import FastString import Maybes -import Monad +import Control.Monad \end{code} @@ -197,4 +197,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}