Commit 11657c4b authored by Simon Peyton Jones's avatar Simon Peyton Jones

Better pretty-printing for CHoleCan

Debug-only; no change in mainstream behaviour
parent 74af2e72
......@@ -196,7 +196,8 @@ data UnboundVar
deriving Data
instance Outputable UnboundVar where
ppr = ppr . unboundVarOcc
ppr (OutOfScope occ _) = text "OutOfScope" <> parens (ppr occ)
ppr (TrueExprHole occ) = text "ExprHole" <> parens (ppr occ)
unboundVarOcc :: UnboundVar -> OccName
unboundVarOcc (OutOfScope occ _) = occ
......
......@@ -1671,6 +1671,10 @@ data Hole = ExprHole UnboundVar
| TypeHole OccName
-- ^ A hole in a type (PartialTypeSignatures)
instance Outputable Hole where
ppr (ExprHole ub) = ppr ub
ppr (TypeHole occ) = text "TypeHole" <> parens (ppr occ)
holeOcc :: Hole -> OccName
holeOcc (ExprHole uv) = unboundVarOcc uv
holeOcc (TypeHole occ) = occ
......@@ -1784,7 +1788,7 @@ instance Outputable Ct where
| pend_sc -> text "CDictCan(psc)"
| otherwise -> text "CDictCan"
CIrredEvCan {} -> text "CIrredEvCan"
CHoleCan { cc_hole = hole } -> text "CHoleCan:" <+> ppr (holeOcc hole)
CHoleCan { cc_hole = hole } -> text "CHoleCan:" <+> ppr hole
{-
************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment