summaryrefslogtreecommitdiff
path: root/libraries/base/Debug/Trace.hs
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-08-07 15:55:45 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-08-07 15:55:45 +0000
commit36129742933ef96f6d4669ee5f73786d1a10a449 (patch)
treeab2c8c86ffe3753a36a8965ea2170811fb5cb0e0 /libraries/base/Debug/Trace.hs
parentf9a5721c7b547fdb5505aa32c9bbf841c239153f (diff)
downloadhaskell-36129742933ef96f6d4669ee5f73786d1a10a449.tar.gz
add traceShow (see #474)
Diffstat (limited to 'libraries/base/Debug/Trace.hs')
-rw-r--r--libraries/base/Debug/Trace.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs
index 84de4d6b1b..40915215c9 100644
--- a/libraries/base/Debug/Trace.hs
+++ b/libraries/base/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