summaryrefslogtreecommitdiff
path: root/compiler/ghci/Debugger.hs
diff options
context:
space:
mode:
authorPepe Iborra <mnislaih@gmail.com>2007-09-12 15:35:05 +0000
committerPepe Iborra <mnislaih@gmail.com>2007-09-12 15:35:05 +0000
commitc9bcc18e7aaa51677f7e2aa1efb2f80c6e2dff8d (patch)
tree96856d60fd8a19a06da092042a50b38469a9a906 /compiler/ghci/Debugger.hs
parent966eddaab3b30ae85f95ea3c981462a9778f1dd7 (diff)
downloadhaskell-c9bcc18e7aaa51677f7e2aa1efb2f80c6e2dff8d.tar.gz
GHCi debugger: Added a -fprint-evld-with-show flag
The flag enables the use of Show instances in :print. By default they are not used anymore
Diffstat (limited to 'compiler/ghci/Debugger.hs')
-rw-r--r--compiler/ghci/Debugger.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/ghci/Debugger.hs b/compiler/ghci/Debugger.hs
index 179f68403b..5833e26d40 100644
--- a/compiler/ghci/Debugger.hs
+++ b/compiler/ghci/Debugger.hs
@@ -25,6 +25,7 @@ import Name
import UniqSupply
import TcType
import GHC
+import DynFlags
import InteractiveEval
import Outputable
import Pretty ( Mode(..), showDocWith )
@@ -138,7 +139,11 @@ bindSuspensions cms@(Session ref) t = do
-- A custom Term printer to enable the use of Show instances
showTerm :: Session -> Term -> IO SDoc
-showTerm cms@(Session ref) = cPprTerm (liftM2 (++) cPprShowable cPprTermBase)
+showTerm cms@(Session ref) term = do
+ dflags <- GHC.getSessionDynFlags cms
+ if dopt Opt_PrintEvldWithShow dflags
+ then cPprTerm (liftM2 (++) cPprShowable cPprTermBase) term
+ else cPprTerm cPprTermBase term
where
cPprShowable _y = [\prec ty _ val tt ->
if not (all isFullyEvaluatedTerm tt)