summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Tennie <sven.tennie@gmail.com>2022-02-23 19:03:47 +0100
committerSven Tennie <sven.tennie@gmail.com>2022-02-23 19:03:47 +0100
commit6cf92af292f99c3ef01e85f1e204be1efad1ecb1 (patch)
tree8b82457097ea84872929a995e92a0a3d7cc59a6f
parent73547190c7c72915bf56e833bf2f64c8406aabd6 (diff)
downloadhaskell-wip/ghc-exception-stacktraces.tar.gz
Apply haddock suggestions from the proposal PRwip/ghc-exception-stacktraces
-rw-r--r--libraries/base/GHC/Exception.hs4
-rw-r--r--libraries/base/GHC/Exception/Backtrace.hs4
-rw-r--r--libraries/base/GHC/Exception/Type.hs2
3 files changed, 5 insertions, 5 deletions
diff --git a/libraries/base/GHC/Exception.hs b/libraries/base/GHC/Exception.hs
index b66958f2d0..8e856ca2cc 100644
--- a/libraries/base/GHC/Exception.hs
+++ b/libraries/base/GHC/Exception.hs
@@ -56,8 +56,8 @@ import GHC.Stack.Types
-- 'Backtrace' backtraces are collected according to the configured
-- 'BacktraceMechanism's.
--
--- WARNING: You may want to use 'throwIO' instead so that your pure code
--- stays exception-free.
+-- WARNING: If you are in an `IO` context you may want to rather use 'throwIO'
+-- instead so that your pure code stays exception-free.
throw :: HasCallStack => forall (r :: RuntimeRep). forall (a :: TYPE r). forall e.
Exception e => e -> a
throw e =
diff --git a/libraries/base/GHC/Exception/Backtrace.hs b/libraries/base/GHC/Exception/Backtrace.hs
index 13faba26de..8f955fa8d2 100644
--- a/libraries/base/GHC/Exception/Backtrace.hs
+++ b/libraries/base/GHC/Exception/Backtrace.hs
@@ -94,9 +94,9 @@ setDefaultBacktraceMechanisms = writeIORef currentBacktraceMechanisms
getDefaultBacktraceMechanisms :: IO [BacktraceMechanism]
getDefaultBacktraceMechanisms = readIORef currentBacktraceMechanisms
--- | Collect a list of 'Backtrace' via all current default 'BacktraceMechanism'.
+-- | Collect a list of 'Backtrace's via all current default 'BacktraceMechanism's.
-- See 'setDefaultBacktraceMechanisms'
-collectBacktraces :: HasCallStack =>IO [Backtrace]
+collectBacktraces :: HasCallStack => IO [Backtrace]
collectBacktraces = do
mechs <- getDefaultBacktraceMechanisms
catMaybes `fmap` mapM collectBacktraces' mechs
diff --git a/libraries/base/GHC/Exception/Type.hs b/libraries/base/GHC/Exception/Type.hs
index edd3e2e5be..67ea90ce5f 100644
--- a/libraries/base/GHC/Exception/Type.hs
+++ b/libraries/base/GHC/Exception/Type.hs
@@ -154,7 +154,7 @@ class (Typeable e, Show e) => Exception e where
-- | Represent the exception as 'SomeExceptionWithBacktrace'
-- If @e@ isn't already of type 'SomeExceptionWithBacktrace' this means some kind of wrapping.
toException :: e -> SomeExceptionWithBacktrace
- -- | Extract and cast the exception from it's wrapped representation
+ -- | Extract and cast the exception from its wrapped representation
-- If the exception cannot be casted to the expected type then the result is 'Nothing'.
fromException :: SomeExceptionWithBacktrace -> Maybe e