From 72e5908f7355d6486b9886b08ebeec15694fcacc Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Sat, 26 Aug 2006 12:43:46 +0000 Subject: [PATCH 1/1] Clarify how one hides Prelude.catch User feedback indicated that an example was required, of how to hide Prelude.catch, so add such an example to the docs --- Control/Exception.hs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Control/Exception.hs b/Control/Exception.hs index 38ead58..f351f87 100644 --- a/Control/Exception.hs +++ b/Control/Exception.hs @@ -178,11 +178,19 @@ import Data.Dynamic -- Also note that the "Prelude" also exports a function called -- 'Prelude.catch' with a similar type to 'Control.Exception.catch', -- except that the "Prelude" version only catches the IO and user --- families of exceptions (as required by Haskell 98). We recommend --- either hiding the "Prelude" version of --- 'Prelude.catch' when importing --- "Control.Exception", or importing --- "Control.Exception" qualified, to avoid name-clashes. +-- families of exceptions (as required by Haskell 98). +-- +-- We recommend either hiding the "Prelude" version of 'Prelude.catch' +-- when importing "Control.Exception": +-- +-- > import Prelude hiding (catch) +-- +-- or importing "Control.Exception" qualified, to avoid name-clashes: +-- +-- > import qualified Control.Exception as C +-- +-- and then using @C.catch@ +-- catch :: IO a -- ^ The computation to run -> (Exception -> IO a) -- ^ Handler to invoke if an exception is raised -- 1.7.10.4