From 4dab7f8c94eb9709de6ce372e4c5ecd127c3f176 Mon Sep 17 00:00:00 2001 From: MorrowM Date: Sat, 4 Mar 2023 15:58:31 +0200 Subject: Fix documentation for traceWith and friends (cherry picked from commit 2aa0770845631e4355f55694f49b3e4b66ecf751) --- libraries/base/Debug/Trace.hs | 6 +++--- libraries/base/changelog.md | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'libraries') 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)) -- cgit v1.2.1