Prelude.catch vs. Exception.catch

Simon Marlow simonmar@microsoft.com
Mon, 13 May 2002 16:44:32 +0100


> I notice that Prelude.catch and Exception.catch behave=20
> differently, even=20
> though they both have the same type signature (and name).=20
> Exception.catch=20
> catches exceptions that Prelude.catch does not.

Prelude.catch catches IO exceptions only, because this is what the
Haskell report specifies.  i.e. the meaning of

	Prelude.catch undefined (\e -> return 42)

should be undefined rather than 'return 42'.  We can't change the
meaning of Prelude.catch without deviating from Haskell 98.  The idea is
that if you want to use Exceptions in their full glory, you:

	import Prelude hiding (catch)
	import Exception

or (my favourite)

	import qualified Exception

Cheers,
	Simon