[Haskell-cafe] Problem about exception.

Brandon S Allbery KF8NH allbery.b at gmail.com
Thu Jan 27 04:06:23 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 1/26/11 22:00 , Magicloud Magiclouds wrote:
> This is one way. But so the outer function could not know what
> happened in "really wrong" situation.

How so?

(1) fromException lets you test it:  if (fromException e :: Maybe
ControlException) returns a (Just ce), then you have a ControlException.

(2) see under (catches) for examples of how to catch specific exception
types.  If you don't catch anything but ControlException then the exception
propagates upward unchanged, which is exactly what you want.

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university      KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1A4S8ACgkQIn7hlCsL25VKgwCdF0rEO7FI2EFA7kQf2dEC70Oc
mdIAnRz69xJCGzdNoDzSFn/NFic+rL5t
=2qNi
-----END PGP SIGNATURE-----



More information about the Haskell-Cafe mailing list