[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-----
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.
(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/
-----END PGP SIGNATURE-----
More information about the Haskell-Cafe