- class MonadIO m => MonadCatchIO m where
- data Exception
- = ArithException ArithException
- | ArrayException ArrayException
- | AssertionFailed String
- | AsyncException AsyncException
- | BlockedOnDeadMVar
- | BlockedIndefinitely
- | NestedAtomically
- | Deadlock
- | DynException Dynamic
- | ErrorCall String
- | ExitException ExitCode
- | IOException IOException
- | NoMethodError String
- | NonTermination
- | PatternMatchFail String
- | RecConError String
- | RecSelError String
- | RecUpdError String
- throw :: MonadCatchIO m => Exception -> m a
- throwDyn :: Typeable e => e -> b
- catchDyn :: (Typeable e, MonadCatchIO m) => m a -> (e -> m a) -> m a
- try :: MonadCatchIO m => m a -> m (Either Exception a)
- tryJust :: MonadCatchIO m => (Exception -> Maybe b) -> m a -> m (Either b a)
Documentation
class MonadIO m => MonadCatchIO m whereSource
catch :: m a -> (Exception -> m a) -> m aSource
Generalized version of catch
Generalized version of block
Generalized version of unblock
MonadCatchIO IO | |
(Monoid w, MonadCatchIO m) => MonadCatchIO (WriterT w m) | |
MonadCatchIO m => MonadCatchIO (StateT s m) | |
(MonadCatchIO m, Error e) => MonadCatchIO (ErrorT e m) | |
MonadCatchIO m => MonadCatchIO (ReaderT r m) | |
(Monoid w, MonadCatchIO m) => MonadCatchIO (RWST r w s m) |
data Exception
The type of exceptions. Every kind of system-generated exception
has a constructor in the Exception
type, and values of other
types may be injected into Exception
by coercing them to
Dynamic
(see the section on Dynamic Exceptions:
Control.OldException).
ArithException ArithException | Exceptions raised by arithmetic
operations. (NOTE: GHC currently does not throw
|
ArrayException ArrayException | Exceptions raised by array-related
operations. (NOTE: GHC currently does not throw
|
AssertionFailed String | This exception is thrown by the
|
AsyncException AsyncException | Asynchronous exceptions (see section on Asynchronous Exceptions: Control.OldException). |
BlockedOnDeadMVar | The current thread was executing a call to Control.Concurrent.MVar.takeMVar that could never return, because there are no other references to this MVar. |
BlockedIndefinitely | The current thread was waiting to retry an atomic memory transaction that could never become possible to complete because there are no other threads referring to any of the TVars involved. |
NestedAtomically | The runtime detected an attempt to nest one STM transaction
inside another one, presumably due to the use of
unsafePeformIO with |
Deadlock | There are no runnable threads, so the program is
deadlocked. The |
DynException Dynamic | Dynamically typed exceptions (see section on Dynamic Exceptions: Control.OldException). |
ErrorCall String | The |
ExitException ExitCode | The |
IOException IOException | These are the standard IO exceptions generated by
Haskell's |
NoMethodError String | An attempt was made to invoke a class method which has no definition in this instance, and there was no default definition given in the class declaration. GHC issues a warning when you compile an instance which has missing methods. |
NonTermination | The current thread is stuck in an infinite loop. This exception may or may not be thrown when the program is non-terminating. |
PatternMatchFail String | A pattern matching failure. The |
RecConError String | An attempt was made to evaluate a field of a record
for which no value was given at construction time. The
|
RecSelError String | A field selection was attempted on a constructor that
doesn't have the requested field. This can happen with
multi-constructor records when one or more fields are
missing from some of the constructors. The
|
RecUpdError String | An attempt was made to update a field in a record,
where the record doesn't have the requested field. This can
only occur with multi-constructor records, when one or more
fields are missing from some of the constructors. The
|
throw :: MonadCatchIO m => Exception -> m aSource
Generalized version of throwIO
catchDyn :: (Typeable e, MonadCatchIO m) => m a -> (e -> m a) -> m aSource