summaryrefslogtreecommitdiff
path: root/libraries/base/Debug
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2013-09-21 14:16:45 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2013-09-21 14:16:45 +0200
commit77f32dad3bef5b641a9d15f69ad2e0f058ade67a (patch)
treefa9f41552d5dde6ce6ac1700d4ed3c44b2aa2652 /libraries/base/Debug
parent957511b3816ec58c02fd33d5d115f7f6eef2b6b8 (diff)
downloadhaskell-77f32dad3bef5b641a9d15f69ad2e0f058ade67a.tar.gz
Add Haddock `/Since: 4.7.0.0/` comments to new symbols
These annotations were added in such a way, that the line {{{ /Since: 4.7.0.0/ }}} represents the last paragraph of the Haddock comment. Maybe Haddock will have support for this meta-syntax at some point, and be able to inherited the since-version property to the children of an annotated symbol and display the since-version property in the rendered documentation only in cases when it's not visually obvious (for instance, when re-exporting documentation strings). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'libraries/base/Debug')
-rw-r--r--libraries/base/Debug/Trace.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs
index 7f78a85c0c..a857760dee 100644
--- a/libraries/base/Debug/Trace.hs
+++ b/libraries/base/Debug/Trace.hs
@@ -105,6 +105,8 @@ trace string expr = unsafePerformIO $ do
{-|
Like 'trace' but returns the message instead of a third value.
+
+/Since: 4.7.0.0/
-}
traceId :: String -> String
traceId a = trace a a
@@ -127,6 +129,8 @@ traceShow = trace . show
{-|
Like 'traceShow' but returns the shown value instead of a third value.
+
+/Since: 4.7.0.0/
-}
traceShowId :: (Show a) => a -> a
traceShowId a = trace (show a) a
@@ -141,6 +145,8 @@ monad, as 'traceIO' is in the 'IO' monad.
> traceM $ "x: " ++ show x
> y <- ...
> traceM $ "y: " ++ show y
+
+/Since: 4.7.0.0/
-}
traceM :: (Monad m) => String -> m ()
traceM string = trace string $ return ()
@@ -153,6 +159,8 @@ Like 'traceM', but uses 'show' on the argument to convert it to a 'String'.
> traceMShow $ x
> y <- ...
> traceMShow $ x + y
+
+/Since: 4.7.0.0/
-}
traceShowM :: (Show a, Monad m) => a -> m ()
traceShowM = traceM . show
@@ -246,6 +254,7 @@ traceEventIO msg =
-- duplicate events emitted if two CPUs simultaneously evaluate the same thunk
-- that uses 'traceMarker'.
--
+-- /Since: 4.7.0.0/
traceMarker :: String -> a -> a
traceMarker msg expr = unsafeDupablePerformIO $ do
traceMarkerIO msg
@@ -257,6 +266,7 @@ traceMarker msg expr = unsafeDupablePerformIO $ do
-- Compared to 'traceMarker', 'traceMarkerIO' sequences the event with respect to
-- other IO actions.
--
+-- /Since: 4.7.0.0/
traceMarkerIO :: String -> IO ()
traceMarkerIO msg =
GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s ->