[project @ 2006-01-06 16:30:17 by simonmar]
[ghc-hetmet.git] / ghc / compiler / typecheck / Inst.lhs
index 8e586b0..d6cf344 100644 (file)
@@ -43,8 +43,7 @@ import {-# SOURCE #-} TcUnify ( unifyTauTy )  -- Used in checkKind (sigh)
 
 import HsSyn   ( HsLit(..), HsOverLit(..), HsExpr(..), LHsExpr, mkHsApp,
                  nlHsLit, nlHsVar )
-import TcHsSyn ( TcId, TcIdSet, 
-                 mkHsTyApp, mkHsDictApp, zonkId, 
+import TcHsSyn ( mkHsTyApp, mkHsDictApp, zonkId, 
                  mkCoercion, ExprCoFn
                )
 import TcRnMonad
@@ -59,12 +58,12 @@ import TcMType      ( zonkTcType, zonkTcTypes, zonkTcPredType, zonkTcThetaType,
 import TcType  ( Type, TcType, TcThetaType, TcTyVarSet, TcTyVar, TcPredType,
                  PredType(..), SkolemInfo(..), typeKind, mkSigmaTy,
                  tcSplitForAllTys, mkFunTy,
-                 tcSplitPhiTy, tcIsTyVarTy, tcSplitDFunHead,
+                 tcSplitPhiTy, tcSplitDFunHead,
                  isIntTy,isFloatTy, isIntegerTy, isDoubleTy,
                  mkPredTy, mkTyVarTy, mkTyVarTys,
                  tyVarsOfType, tyVarsOfTypes, tyVarsOfPred, tidyPred,
                  isClassPred, isTyVarClassPred, isLinearPred, 
-                 getClassPredTys, getClassPredTys_maybe, mkPredName,
+                 getClassPredTys, mkPredName,
                  isInheritablePred, isIPPred, 
                  tidyType, tidyTypes, tidyFreeTyVars, tcSplitSigmaTy, 
                  pprPred, pprParendType, pprTheta 
@@ -78,9 +77,9 @@ import HscTypes       ( ExternalPackageState(..) )
 import CoreFVs ( idFreeTyVars )
 import DataCon ( DataCon, dataConTyVars, dataConStupidTheta, dataConName, dataConWrapId )
 import Id      ( Id, idName, idType, mkUserLocal, mkLocalId )
-import PrelInfo        ( isStandardClass, isNoDictClass )
+import PrelInfo        ( isNoDictClass )
 import Name    ( Name, mkMethodOcc, getOccName, getSrcLoc, nameModule,
-                 isInternalName, setNameUnique, mkSystemVarNameEncoded )
+                 isInternalName, setNameUnique, mkSystemVarName )
 import NameSet ( addOneToNameSet )
 import Literal ( inIntRange )
 import Var     ( TyVar, tyVarKind, setIdType )
@@ -399,9 +398,7 @@ newLitInst orig lit expected_ty     -- Make a LitInst
   = do         { loc <- getInstLoc orig
        ; new_uniq <- newUnique
        ; let
-               lit_nm   = mkSystemVarNameEncoded new_uniq FSLIT("lit")
-               -- The "encoded" bit means that we don't need to
-               -- z-encode the string every time we call this!
+               lit_nm   = mkSystemVarName new_uniq FSLIT("lit")
                lit_inst = LitInst lit_nm lit expected_ty loc
        ; extendLIE lit_inst
        ; return (HsVar (instToId lit_inst)) }
@@ -771,11 +768,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)