Simon's big boxy-type commit
[ghc-hetmet.git] / ghc / compiler / main / PprTyThing.hs
index 09b7af6..2763b05 100644 (file)
@@ -67,8 +67,10 @@ pprTyThingHdr exts (AClass cls)       = pprClassHdr   exts cls
 pprTyConHdr exts tyCon =
   ptext keyword <+> ppr_bndr tyCon <+> hsep (map ppr vars)
   where
-    vars = GHC.tyConTyVars tyCon
-    
+    vars | GHC.isPrimTyCon tyCon || 
+          GHC.isFunTyCon tyCon = take (GHC.tyConArity tyCon) GHC.alphaTyVars
+        | otherwise = GHC.tyConTyVars tyCon
+
     keyword | GHC.isSynTyCon tyCon = SLIT("type")
             | GHC.isNewTyCon tyCon = SLIT("newtype")
             | otherwise            = SLIT("data")
@@ -105,7 +107,7 @@ pprType False ty = ppr (GHC.dropForAlls ty)
 
 pprTyCon exts tyCon
   | GHC.isSynTyCon tyCon
-  = let (_,rhs_type) = GHC.getSynTyConDefn tyCon
+  = let rhs_type = GHC.synTyConRhs tyCon
     in hang (pprTyConHdr exts tyCon <+> equals) 2 (pprType exts rhs_type)
   | otherwise
   = pprAlgTyCon exts tyCon (const True) (const True)