summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Ppr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core/Ppr.hs')
-rw-r--r--compiler/GHC/Core/Ppr.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs
index b319abec08..816af025fc 100644
--- a/compiler/GHC/Core/Ppr.hs
+++ b/compiler/GHC/Core/Ppr.hs
@@ -22,7 +22,7 @@ module GHC.Core.Ppr (
pprCoreExpr, pprParendExpr,
pprCoreBinding, pprCoreBindings, pprCoreAlt,
pprCoreBindingWithSize, pprCoreBindingsWithSize,
- pprCoreBinder, pprCoreBinders,
+ pprCoreBinder, pprCoreBinders, pprId, pprIds,
pprRule, pprRules, pprOptCo,
pprOcc, pprOccWithTick
) where
@@ -462,6 +462,13 @@ pprKindedTyVarBndr :: TyVar -> SDoc
pprKindedTyVarBndr tyvar
= text "@" <> pprTyVar tyvar
+-- pprId x prints x :: ty
+pprId :: Id -> SDoc
+pprId x = ppr x <+> dcolon <+> ppr (idType x)
+
+pprIds :: [Id] -> SDoc
+pprIds xs = sep (map pprId xs)
+
-- pprIdBndr does *not* print the type
-- When printing any Id binder in debug mode, we print its inline pragma and one-shot-ness
pprIdBndr :: Id -> SDoc