summaryrefslogtreecommitdiff
path: root/compiler/ghci/RtClosureInspect.hs
diff options
context:
space:
mode:
authorPepe Iborra <mnislaih@gmail.com>2007-12-08 19:30:13 +0000
committerPepe Iborra <mnislaih@gmail.com>2007-12-08 19:30:13 +0000
commit19c2956ac20bdfe103ab100ff57d1a2e20cd521f (patch)
tree2a8b0f78b250b124ba6a66208af0ab658f49d2d1 /compiler/ghci/RtClosureInspect.hs
parentcf71c5a6df7c7fea777da0e0b91e937538287caa (diff)
downloadhaskell-19c2956ac20bdfe103ab100ff57d1a2e20cd521f.tar.gz
Change the format used by :print to show the content of references
This comes as result of the short discussion linked below. http://www.haskell.org/pipermail/cvs-ghc/2007-December/040049.html
Diffstat (limited to 'compiler/ghci/RtClosureInspect.hs')
-rw-r--r--compiler/ghci/RtClosureInspect.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs
index 1abee5710f..585ca1c889 100644
--- a/compiler/ghci/RtClosureInspect.hs
+++ b/compiler/ghci/RtClosureInspect.hs
@@ -369,7 +369,14 @@ ppr_termM y p Term{dc=Right dc, subTerms=tt}
return$ cparen (p >= app_prec) (ppr dc <+> pprDeeperList fsep tt_docs)
ppr_termM y p t@NewtypeWrap{} = pprNewtypeWrap y p t
-ppr_termM y p RefWrap{wrapped_term=t} = braces `liftM` y p t
+ppr_termM y p RefWrap{wrapped_term=t, ty=ty} = do
+ contents <- y app_prec t
+ return$ cparen (p >= app_prec) (text "GHC.Prim.MutVar#" <+> contents)
+ -- The constructor name is wired in here ^^^ for the sake of simplicity.
+ -- I don't think mutvars are going to change in a near future.
+ -- In any case this is solely a presentation matter: MutVar# is
+ -- a datatype with no constructors, implemented by the RTS
+ -- (hence there is no way to obtain a datacon and print it).
ppr_termM _ _ t = ppr_termM1 t