From: Don Stewart Date: Sat, 26 Aug 2006 12:43:46 +0000 (+0000) Subject: Clarify how one hides Prelude.catch X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=72e5908f7355d6486b9886b08ebeec15694fcacc;p=ghc-base.git 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 --- 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