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")
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)