[Git][ghc/ghc][master] Update doc string for traceShow
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Fri Nov 17 01:54:54 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
94ff2134 by Oleg Alexander at 2023-11-16T20:54:15-05:00
Update doc string for traceShow
Updated doc string for traceShow.
- - - - -
1 changed file:
- libraries/base/src/Debug/Trace.hs
Changes:
=====================================
libraries/base/src/Debug/Trace.hs
=====================================
@@ -143,13 +143,15 @@ traceId a = trace a a
Like 'trace', but uses 'show' on the argument to convert it to a 'String'.
This makes it convenient for printing the values of interesting variables or
-expressions inside a function. For example here we print the value of the
+expressions inside a function. For example, here we print the values of the
variables @x@ and @y@:
->>> let f x y = traceShow (x,y) (x + y) in f (1+2) 5
-(3,5)
+>>> let f x y = traceShow ("x", x, "y", y) (x + y) in f (1+2) 5
+("x",3,"y",5)
8
+Note in this example we also create simple labels just by including some strings.
+
-}
traceShow :: Show a => a -> b -> b
traceShow = trace . show
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/94ff2134c52f5c1bcc0e5f20c5f760a755c24459
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/94ff2134c52f5c1bcc0e5f20c5f760a755c24459
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231116/e2808dc7/attachment-0001.html>
More information about the ghc-commits
mailing list