summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorrowM <themorrowm@gmail.com>2023-03-04 15:58:31 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-07 21:22:22 -0500
commit2aa0770845631e4355f55694f49b3e4b66ecf751 (patch)
tree1be395deeec01340184cc0fa0e33d930c2f9fad3
parentfa559c28d22888a4ba497daca2c1d5afdebb716c (diff)
downloadhaskell-2aa0770845631e4355f55694f49b3e4b66ecf751.tar.gz
Fix documentation for traceWith and friends
-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 48e4ff3a2b..21a52c94ab 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -83,6 +83,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).
## 4.17.0.0 *August 2022*