diff options
author | amesgen <amesgen@amesgen.de> | 2022-11-27 20:29:19 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-18 19:33:49 -0500 |
commit | 6fe2d778e9ad015f35c520724d7f222a015586ed (patch) | |
tree | b15f2add1002ef0634311250c2b4bad1248c139a /libraries | |
parent | ad21f4efe6882ca0929db6bd331db174a36e41aa (diff) | |
download | haskell-6fe2d778e9ad015f35c520724d7f222a015586ed.tar.gz |
Correct `exitWith` Haddocks
The `IOError`-specific `catch` in the Prelude is long gone.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/base/System/Exit.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libraries/base/System/Exit.hs b/libraries/base/System/Exit.hs index e4f7b13e33..957c0b9106 100644 --- a/libraries/base/System/Exit.hs +++ b/libraries/base/System/Exit.hs @@ -45,16 +45,14 @@ import GHC.IO.Exception -- A program that terminates successfully without calling 'exitWith' -- explicitly is treated as if it had called 'exitWith' 'ExitSuccess'. -- --- As an 'ExitCode' is not an 'IOError', 'exitWith' bypasses --- the error handling in the 'IO' monad and cannot be intercepted by --- 'catch' from the "Prelude". However it is a 'Control.Exception.SomeException', and can --- be caught using the functions of "Control.Exception". This means --- that cleanup computations added with 'Control.Exception.bracket' --- (from "Control.Exception") are also executed properly on 'exitWith'. +-- As an 'ExitCode' is an 'Control.Exception.Exception', it can be +-- caught using the functions of "Control.Exception". This means that +-- cleanup computations added with 'Control.Exception.bracket' (from +-- "Control.Exception") are also executed properly on 'exitWith'. -- -- Note: in GHC, 'exitWith' should be called from the main program -- thread in order to exit the process. When called from another --- thread, 'exitWith' will throw an 'ExitException' as normal, but the +-- thread, 'exitWith' will throw an 'ExitCode' as normal, but the -- exception will not cause the process itself to exit. -- exitWith :: ExitCode -> IO a |