summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-04-25 09:12:44 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2015-04-25 09:49:02 +0200
commit75adc352549a43d4c37bd3bdade55cecf3d75bb1 (patch)
tree99cdd2221f7677ee7905db51977565e8160d832b /libraries/base
parentc4e8097ea8dd6e43eae7aadd6bae7e13272ba74d (diff)
downloadhaskell-75adc352549a43d4c37bd3bdade55cecf3d75bb1.tar.gz
Add missing since-annotations for c024af131b9e2538
See also #9049
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/GHC/SrcLoc.hs7
-rw-r--r--libraries/base/GHC/Stack.hsc7
2 files changed, 13 insertions, 1 deletions
diff --git a/libraries/base/GHC/SrcLoc.hs b/libraries/base/GHC/SrcLoc.hs
index 16ebbab74c..23a109bd8f 100644
--- a/libraries/base/GHC/SrcLoc.hs
+++ b/libraries/base/GHC/SrcLoc.hs
@@ -1,4 +1,6 @@
{-# LANGUAGE RecordWildCards #-}
+
+-- | @since 4.8.2.0
module GHC.SrcLoc
( SrcLoc
, srcLocPackage
@@ -14,6 +16,8 @@ module GHC.SrcLoc
) where
-- | A single location in the source code.
+--
+-- @since 4.8.2.0
data SrcLoc = SrcLoc
{ srcLocPackage :: String
, srcLocModule :: String
@@ -24,6 +28,9 @@ data SrcLoc = SrcLoc
, srcLocEndCol :: Int
} deriving (Show, Eq)
+-- | Pretty print 'SrcLoc'
+--
+-- @since 4.8.2.0
showSrcLoc :: SrcLoc -> String
showSrcLoc SrcLoc {..}
= concat [ srcLocFile, ":"
diff --git a/libraries/base/GHC/Stack.hsc b/libraries/base/GHC/Stack.hsc
index 8c9f0c1f41..40fba7dcc8 100644
--- a/libraries/base/GHC/Stack.hsc
+++ b/libraries/base/GHC/Stack.hsc
@@ -24,6 +24,8 @@ module GHC.Stack (
errorWithStackTrace,
-- ** Explicitly created via implicit-parameters
+ --
+ -- @since 4.8.2.0
CallStack,
getCallStack,
showCallStack,
@@ -171,11 +173,14 @@ errorWithStackTrace x = unsafeDupablePerformIO $ do
-- that was called, the 'SrcLoc' is the call-site. The list is ordered with the
-- most recently called function at the head.
--
--- @since 4.9.0.0
+-- @since 4.8.2.0
data CallStack = CallStack { getCallStack :: [(String, SrcLoc)] }
-- See Note [Overview of implicit CallStacks]
deriving (Show, Eq)
+-- | Pretty print 'CallStack'
+--
+-- @since 4.8.2.0
showCallStack :: CallStack -> String
showCallStack (CallStack (root:rest))
= unlines (showCallSite root : map (indent . showCallSite) rest)