Merge remote branch 'origin/master' into ghc-new-co
[ghc-hetmet.git] / compiler / ghci / RtClosureInspect.hs
index 5d74dc9..884661f 100644 (file)
@@ -59,12 +59,7 @@ import Constants        ( wORD_SIZE )
 
 import GHC.Arr          ( Array(..) )
 import GHC.Exts
-
-#if __GLASGOW_HASKELL__ >= 611
 import GHC.IO ( IO(..) )
-#else
-import GHC.IOBase ( IO(..) )
-#endif
 
 import Control.Monad
 import Data.Maybe
@@ -453,7 +448,7 @@ cPprTermBase y =
            --Note pprinting of list terms is not lazy
            doList p (Term{subTerms=[h,t]}) = do
                let elems      = h : getListTerms t
-                   isConsLast = not(termType(last elems) `coreEqType` termType h)
+                   isConsLast = not(termType(last elems) `eqType` termType h)
                print_elems <- mapM (y cons_prec) elems
                return$ if isConsLast
                      then cparen (p >= cons_prec) 
@@ -574,20 +569,17 @@ newVar = liftTcM . newFlexiTyVarTy
 type RttiInstantiation = [(TcTyVar, TyVar)]
    -- Associates the typechecker-world meta type variables 
    -- (which are mutable and may be refined), to their 
-   -- debugger-world RuntimeUnkSkol counterparts.
+   -- debugger-world RuntimeUnk counterparts.
    -- If the TcTyVar has not been refined by the runtime type
    -- elaboration, then we want to turn it back into the
-   -- original RuntimeUnkSkol
+   -- original RuntimeUnk
 
 -- | Returns the instantiated type scheme ty', and the 
 --   mapping from new (instantiated) -to- old (skolem) type variables
---   We want this mapping just for old RuntimeUnkSkols, to avoid
---   gratuitously changing their unique on every trip
 instScheme :: QuantifiedType -> TR (TcType, RttiInstantiation)
 instScheme (tvs, ty) 
   = liftTcM $ do { (tvs', _, subst) <- tcInstTyVars tvs
-                 ; let rtti_inst = [(tv',tv) | (tv',tv) <- tvs' `zip` tvs
-                                             , isRuntimeUnkSkol tv]
+                 ; let rtti_inst = [(tv',tv) | (tv',tv) <- tvs' `zip` tvs]
                  ; return (substTy subst ty, rtti_inst) }
 
 applyRevSubst :: RttiInstantiation -> TR ()
@@ -887,8 +879,8 @@ improveRTTIType _ base_ty new_ty
 
 myDataConInstArgTys :: DataCon -> [Type] -> [Type]
 myDataConInstArgTys dc args
-    | null (dataConExTyVars dc) && null (dataConEqTheta dc) = dataConInstArgTys dc args
-    | otherwise = dataConRepArgTys dc
+ | isVanillaDataCon dc = dataConInstArgTys dc args
+ | otherwise           = dataConRepArgTys dc
 
 mydataConType :: DataCon -> QuantifiedType
 -- ^ Custom version of DataCon.dataConUserType where we
@@ -1137,10 +1129,10 @@ zonkRttiType = zonkType (mkZonkTcTyVar zonk_unbound_meta)
   where
     zonk_unbound_meta tv 
       = ASSERT( isTcTyVar tv )
-        do { tv' <- skolemiseUnboundMetaTyVar RuntimeUnkSkol tv
-            -- This is where RuntimeUnkSkols are born: 
+        do { tv' <- skolemiseUnboundMetaTyVar tv RuntimeUnk
+            -- This is where RuntimeUnks are born: 
             -- otherwise-unconstrained unification variables are
-            -- turned into RuntimeUnkSkols as they leave the
+            -- turned into RuntimeUnks as they leave the
             -- typechecker's monad
            ; return (mkTyVarTy tv') }