add traceShow (see #474)
authorSimon Marlow <simonmar@microsoft.com>
Mon, 7 Aug 2006 15:55:45 +0000 (15:55 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Mon, 7 Aug 2006 15:55:45 +0000 (15:55 +0000)
Debug/Trace.hs

index 84de4d6..4091521 100644 (file)
@@ -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