diff options
author | Pepe Iborra <mnislaih@gmail.com> | 2007-09-11 18:04:11 +0000 |
---|---|---|
committer | Pepe Iborra <mnislaih@gmail.com> | 2007-09-11 18:04:11 +0000 |
commit | 593b7f500268c3eb28146b3e6b46fedd8dba2a2a (patch) | |
tree | 5dee5c55267fe490f5d68b52c133ba24a7bae577 /compiler/ghci/Debugger.hs | |
parent | 9e95b0d6162ea28ad250339affa0d67d2919ef6d (diff) | |
download | haskell-593b7f500268c3eb28146b3e6b46fedd8dba2a2a.tar.gz |
Refactoring & documenting the Term pprinter used by :print
Diffstat (limited to 'compiler/ghci/Debugger.hs')
-rw-r--r-- | compiler/ghci/Debugger.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/ghci/Debugger.hs b/compiler/ghci/Debugger.hs index 36c784b238..179f68403b 100644 --- a/compiler/ghci/Debugger.hs +++ b/compiler/ghci/Debugger.hs @@ -138,10 +138,9 @@ 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 cPpr +showTerm cms@(Session ref) = cPprTerm (liftM2 (++) cPprShowable cPprTermBase) where - cPpr = \p-> cPprShowable : cPprTermBase p - cPprShowable prec ty _ val tt = + cPprShowable _y = [\prec ty _ val tt -> if not (all isFullyEvaluatedTerm tt) then return Nothing else do @@ -164,7 +163,7 @@ showTerm cms@(Session ref) = cPprTerm cPpr _ -> return Nothing `finally` do writeIORef ref hsc_env - GHC.setSessionDynFlags cms dflags + GHC.setSessionDynFlags cms dflags] needsParens ('"':_) = False -- some simple heuristics to see whether parens -- are redundant in an arbitrary Show output needsParens ('(':_) = False |