summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorrowM <themorrowm@gmail.com>2023-03-04 15:58:31 +0200
committerBen Gamari <ben@smart-cactus.org>2023-03-09 15:50:48 -0500
commit4dab7f8c94eb9709de6ce372e4c5ecd127c3f176 (patch)
tree90f6e246c2a161a1968bc3c404e1321a94617a30
parent2d7ca624481e7f4751f83661acc2a183268b52b0 (diff)
downloadhaskell-4dab7f8c94eb9709de6ce372e4c5ecd127c3f176.tar.gz
Fix documentation for traceWith and friends
(cherry picked from commit 2aa0770845631e4355f55694f49b3e4b66ecf751)
-rw-r--r--libraries/base/Debug/Trace.hs6
-rw-r--r--libraries/base/changelog.md3
2 files changed, 6 insertions, 3 deletions
diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs
index 90aed3acb9..b7532c2343 100644
--- a/libraries/base/Debug/Trace.hs
+++ b/libraries/base/Debug/Trace.hs
@@ -173,7 +173,7 @@ Like 'trace', but outputs the result of calling a function on the argument.
hello
("hello","world")
-@since 4.17.0.0
+@since 4.18.0.0
-}
traceWith :: (a -> String) -> a -> a
traceWith f a = trace (f a) a
@@ -186,7 +186,7 @@ a 'String'.
3
[1,2,3]
-@since 4.17.0.0
+@since 4.18.0.0
-}
traceShowWith :: Show b => (a -> b) -> a -> a
traceShowWith f = traceWith (show . f)
@@ -303,7 +303,7 @@ traceEventIO msg =
-- | Like 'traceEvent', but emits the result of calling a function on its
-- argument.
--
--- @since 4.17.0.0
+-- @since 4.18.0.0
traceEventWith :: (a -> String) -> a -> a
traceEventWith f a = traceEvent (f a) a
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 376bd6c34f..ae23e9fb10 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -71,6 +71,9 @@
* `InfoProv` now has additional `ipSrcFile` and `ipSrcSpan` fields. `ipLoc`
is now a function computed from these fields.
* The `whereFrom` function has been moved
+ * Add functions `traceWith`, `traceShowWith`, `traceEventWith` to
+ `Debug.Trace`, per
+ [CLC proposal #36](https://github.com/haskell/core-libraries-committee/issues/36).
* Refactor `generalCategory` to stop very large literal string being inlined to call-sites.
([CLC proposal #130](https://github.com/haskell/core-libraries-committee/issues/130))
* Add INLINABLE pragmas to `generic*` functions in Data.OldList ([CLC proposal #129](https://github.com/haskell/core-libraries-committee/issues/130))