X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FUtils%2FCore%2FCoreShow.hs;h=1db286ec6a7ff27d76826f77da891c4679333b33;hb=eab16fafe7a623b5ea669023b91ddee4b1983526;hp=ac6b1d118c97413a17635fec15ef12a3209c4a50;hpb=aa4e9c5711eaa8fef698c9af0290b1fa65321c79;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git "a/c\316\273ash/CLasH/Utils/Core/CoreShow.hs" "b/c\316\273ash/CLasH/Utils/Core/CoreShow.hs" index ac6b1d1..1db286e 100644 --- "a/c\316\273ash/CLasH/Utils/Core/CoreShow.hs" +++ "b/c\316\273ash/CLasH/Utils/Core/CoreShow.hs" @@ -32,6 +32,7 @@ deriving instance (Show x, OutputableBndr x) => Show (HsExpr.HsExpr x) deriving instance Show (RdrName.RdrName) deriving instance (Show idL, Show idR, OutputableBndr idL, OutputableBndr idR) => Show (HsBinds.HsBindLR idL idR) deriving instance Show CoreSyn.Note +deriving instance Show TyCon.SynTyConRhs -- Implement dummy shows, since deriving them will need loads of other shows @@ -39,7 +40,26 @@ deriving instance Show CoreSyn.Note instance Show TypeRep.PredType where show t = "_PredType:(" ++ (showSDoc $ ppr t) ++ ")" instance Show TyCon.TyCon where - show t = "_TyCon:(" ++ (showSDoc $ ppr t) ++ ")" + show t | TyCon.isAlgTyCon t && not (TyCon.isTupleTyCon t) = + showtc "AlgTyCon" "" + | TyCon.isCoercionTyCon t = + showtc "CoercionTyCon" "" + | TyCon.isSynTyCon t = + showtc "SynTyCon" (", synTcRhs = " ++ synrhs) + | TyCon.isTupleTyCon t = + showtc "TupleTyCon" "" + | TyCon.isFunTyCon t = + showtc "FunTyCon" "" + | TyCon.isPrimTyCon t = + showtc "PrimTyCon" "" + | TyCon.isSuperKindTyCon t = + showtc "SuperKindTyCon" "" + | otherwise = + "_Nonexistant tycon?:(" ++ (showSDoc $ ppr t) ++ ")_" + where + showtc con extra = "(" ++ con ++ " {tyConName = " ++ name ++ extra ++ ", ...})" + name = show (TyCon.tyConName t) + synrhs = show (TyCon.synTyConRhs t) instance Show BasicTypes.Boxity where show b = "_Boxity" instance Show HsTypes.HsExplicitForAll where