[project @ 2005-07-08 11:16:00 by simonmar]
[ghc-hetmet.git] / ghc / compiler / typecheck / Inst.lhs
index 8e8e44a..21466a8 100644 (file)
@@ -27,7 +27,7 @@ module Inst (
 
        isDict, isClassDict, isMethod, 
        isLinearInst, linearInstType, isIPDict, isInheritableInst,
-       isTyVarDict, isStdClassTyVarDict, isMethodFor, 
+       isTyVarDict, isMethodFor, 
        instBindingRequired,
 
        zonkInst, zonkInsts,
@@ -58,10 +58,10 @@ import TcMType      ( zonkTcType, zonkTcTypes, zonkTcPredType, zonkTcThetaType,
                )
 import TcType  ( Type, TcType, TcThetaType, TcTyVarSet, TcTyVar, TcPredType,
                  PredType(..), SkolemInfo(..), typeKind, mkSigmaTy,
-                 tcSplitForAllTys, tcSplitForAllTys, mkFunTy,
+                 tcSplitForAllTys, mkFunTy,
                  tcSplitPhiTy, tcIsTyVarTy, tcSplitDFunHead,
                  isIntTy,isFloatTy, isIntegerTy, isDoubleTy,
-                 tcIsTyVarTy, mkPredTy, mkTyVarTy, mkTyVarTys,
+                 mkPredTy, mkTyVarTy, mkTyVarTys,
                  tyVarsOfType, tyVarsOfTypes, tyVarsOfPred, tidyPred,
                  isClassPred, isTyVarClassPred, isLinearPred, 
                  getClassPredTys, getClassPredTys_maybe, mkPredName,
@@ -194,11 +194,6 @@ isLinearInst other      = False
 
 linearInstType :: Inst -> TcType       -- %x::t  -->  t
 linearInstType (Dict _ (IParam _ ty) _) = ty
-
-
-isStdClassTyVarDict (Dict _ pred _) = case getClassPredTys_maybe pred of
-                                       Just (clas, [ty]) -> isStandardClass clas && tcIsTyVarTy ty
-                                       other             -> False
 \end{code}
 
 Two predicates which deal with the case where class constraints don't
@@ -776,11 +771,11 @@ lookupPred pred@(ClassP clas tys)
 lookupPred ip_pred = return Nothing
 
 record_dfun_usage dfun_id 
-  = do { dflags <- getDOpts
+  = do { gbl <- getGblEnv
        ; let  dfun_name = idName dfun_id
               dfun_mod  = nameModule dfun_name
        ; if isInternalName dfun_name ||    -- Internal name => defined in this module
-            not (isHomeModule dflags dfun_mod)
+            not (isHomeModule (tcg_home_mods gbl) dfun_mod)
          then return () -- internal, or in another package
           else do { tcg_env <- getGblEnv
                   ; updMutVar (tcg_inst_uses tcg_env)