projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2c1ebf
)
add traceShow (see #474)
author
Simon Marlow
<simonmar@microsoft.com>
Mon, 7 Aug 2006 15:55:45 +0000
(15:55 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Mon, 7 Aug 2006 15:55:45 +0000
(15:55 +0000)
Debug/Trace.hs
patch
|
blob
|
history
diff --git
a/Debug/Trace.hs
b/Debug/Trace.hs
index
84de4d6
..
4091521
100644
(file)
--- a/
Debug/Trace.hs
+++ b/
Debug/Trace.hs
@@
-56,3
+56,11
@@
trace :: String -> a -> a
trace string expr = unsafePerformIO $ do
putTraceMsg string
return expr
+
+{-|
+Like 'trace', but uses 'show' on the argument to convert it to a 'String'.
+
+> traceShow = trace . show
+-}
+traceShow :: (Show a) => a -> b -> b
+traceShow = trace . show