summaryrefslogtreecommitdiff
path: root/compiler/main/PprTyThing.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/PprTyThing.hs')
-rw-r--r--compiler/main/PprTyThing.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs
index 1ee18f84e3..0fa7bdff52 100644
--- a/compiler/main/PprTyThing.hs
+++ b/compiler/main/PprTyThing.hs
@@ -165,13 +165,13 @@ pprTypeForUser print_foralls ty
pprTyCon :: PrintExplicitForalls -> ShowSub -> TyCon -> SDoc
pprTyCon pefas ss tyCon
- | GHC.isSynTyCon tyCon
- = if GHC.isFamilyTyCon tyCon
- then pprTyConHdr pefas tyCon <+> dcolon <+>
- pprTypeForUser pefas (GHC.synTyConResKind tyCon)
- else
- let rhs_type = GHC.synTyConType tyCon
- in hang (pprTyConHdr pefas tyCon <+> equals) 2 (pprTypeForUser pefas rhs_type)
+ | Just syn_rhs <- GHC.synTyConRhs_maybe tyCon
+ = case syn_rhs of
+ SynFamilyTyCon {} -> pprTyConHdr pefas tyCon <+> dcolon <+>
+ pprTypeForUser pefas (GHC.synTyConResKind tyCon)
+ SynonymTyCon rhs_ty -> hang (pprTyConHdr pefas tyCon <+> equals)
+ 2 (pprTypeForUser pefas rhs_ty)
+
| Just cls <- GHC.tyConClass_maybe tyCon
= pprClass pefas ss cls
| otherwise