From 1c7caf1c6d5abacb2af32d8224241c575829b9fd Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Wed, 21 Feb 2007 15:11:17 +0000 Subject: [PATCH] Fix the behaviour of :print with functions It now outputs "" instead of showing them as thunks --- compiler/ghci/RtClosureInspect.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index 7a6dee5..8fd15c0 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -313,8 +313,9 @@ printTerm :: Term -> SDoc printTerm Prim{value=value} = text value printTerm t@Term{} = printTerm1 0 t printTerm Suspension{bound_to=Nothing} = char '_' -- <> ppr ct <> char '_' -printTerm Suspension{mb_ty=Just ty, bound_to=Just n} = - parens$ ppr n <> text "::" <> ppr ty +printTerm Suspension{mb_ty=Just ty, bound_to=Just n} + | Just _ <- splitFunTy_maybe ty = text "" + | otherwise = parens$ ppr n <> text "::" <> ppr ty printTerm1 p Term{dc=dc, subTerms=tt} {- | dataConIsInfix dc, (t1:t2:tt') <- tt -- 1.7.10.4