diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-02-13 23:10:18 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-02-13 23:10:44 +0000 |
commit | 7fdded4ed7e670e0c83d312b56a59b36c52913c9 (patch) | |
tree | c2eb0303673a33e3ff2508d0ed584bfca7c52083 /libraries/base | |
parent | b96db75c2ea3ea5756dac7d67ca366dab61bafa7 (diff) | |
download | haskell-7fdded4ed7e670e0c83d312b56a59b36c52913c9.tar.gz |
Improve documentation of 'trace'
See Trac #9795.
Diffstat (limited to 'libraries/base')
-rw-r--r-- | libraries/base/Debug/Trace.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs index 389eb19d1b..c81abbf653 100644 --- a/libraries/base/Debug/Trace.hs +++ b/libraries/base/Debug/Trace.hs @@ -102,6 +102,10 @@ For example, this returns the value of @f x@ but first outputs the message. > trace ("calling f with x = " ++ show x) (f x) +The 'trace' function evaluates the message (i.e. the first argument) completely +before printing it; so if the message is not fully defined, none of it +will be printed. + The 'trace' function should /only/ be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the |