Prelude.catch vs. Exception.catch

Simon Marlow simonmar@microsoft.com
Tue, 14 May 2002 10:24:43 +0100


> At 2002-05-13 22:07, Ashley Yakeley wrote:
>=20
> >I've noticed something a bit unusual about Exception.catch.
>=20
> Curiously, the definition of Exception.evaluate given in the GHC=20
> Libraries documentation sec. 5.12.3 is not that actually=20
> implemented by=20
> GHC.
>=20
>    	evaluate' :: a -> IO a;
>    	evaluate' a =3D a `seq` return a;
>=20
> "evaluate' undefined" is bottom, whereas "Expression.evaluate=20
> undefined"=20
> is an IO action that "fails" when executed. But both will be=20
> caught by Exception.catch.

This is bizarre: the definition of evaluate in Exception is exactly the
one you gave above, yet they behave differently.  You may have uncovered
a compiler bug, I'll look into it.

Cheers,
	Simon