{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+
+#include "Typeable.h"
+
-----------------------------------------------------------------------------
-- |
-- Module : Control.Exception
RecConError(..),
RecSelError(..),
RecUpdError(..),
+ ErrorCall(..),
-- * Throwing exceptions
throwIO, -- :: Exception -> IO a
try, -- :: IO a -> IO (Either Exception a)
tryJust, -- :: (Exception -> Maybe b) -> a -> IO (Either b a)
ignoreExceptions,
+ onException,
-- ** The @evaluate@ function
evaluate, -- :: a -> IO a
ignoreExceptions :: IO () -> IO ()
ignoreExceptions io = io `catchAny` \_ -> return ()
+onException :: IO a -> IO () -> IO a
+onException io what = io `catch` \e -> do what
+ throw (e :: SomeException)
+
-----------------------------------------------------------------------------
-- Some Useful Functions
-----
data PatternMatchFail = PatternMatchFail String
- deriving Typeable
+INSTANCE_TYPEABLE0(PatternMatchFail,patternMatchFailTc,"PatternMatchFail")
instance Exception PatternMatchFail
-----
data RecSelError = RecSelError String
- deriving Typeable
+INSTANCE_TYPEABLE0(RecSelError,recSelErrorTc,"RecSelError")
instance Exception RecSelError
-----
data RecConError = RecConError String
- deriving Typeable
+INSTANCE_TYPEABLE0(RecConError,recConErrorTc,"RecConError")
instance Exception RecConError
-----
data RecUpdError = RecUpdError String
- deriving Typeable
+INSTANCE_TYPEABLE0(RecUpdError,recUpdErrorTc,"RecUpdError")
instance Exception RecUpdError
-----
data NoMethodError = NoMethodError String
- deriving Typeable
+INSTANCE_TYPEABLE0(NoMethodError,noMethodErrorTc,"NoMethodError")
instance Exception NoMethodError
-----
data AssertionFailed = AssertionFailed String
- deriving Typeable
+INSTANCE_TYPEABLE0(AssertionFailed,assertionFailedTc,"AssertionFailed")
instance Exception AssertionFailed
-----
data NonTermination = NonTermination
- deriving Typeable
+INSTANCE_TYPEABLE0(NonTermination,nonTerminationTc,"NonTermination")
instance Exception NonTermination
-----
data Deadlock = Deadlock
- deriving Typeable
+INSTANCE_TYPEABLE0(Deadlock,deadlockTc,"Deadlock")
instance Exception Deadlock
-----
data NestedAtomically = NestedAtomically
- deriving Typeable
+INSTANCE_TYPEABLE0(NestedAtomically,nestedAtomicallyTc,"NestedAtomically")
instance Exception NestedAtomically