Copyright | (c) The University of Glasgow 2001 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | libraries@haskell.org |
Stability | experimental |
Portability | non-portable (uses ExistentialQuantification and DeriveDataTypeable) |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Control.Exception.Extensible
Description
This module provides the extensible exceptions API for raising and catching both built-in and user-defined exceptions.
For newer versions of GHC (>=6.9), this package re-exports Exception
.
Otherwise, it provides a compatibility layer around the previous version of the
extensions API.
Documentation
interruptible :: IO a -> IO a #
class (Typeable e, Show e) => Exception e where #
Minimal complete definition
Nothing
Methods
toException :: e -> SomeException #
fromException :: SomeException -> Maybe e #
displayException :: e -> String #
Instances
data NestedAtomically #
Constructors
NestedAtomically |
Instances
Exception NestedAtomically | |
Defined in Control.Exception.Base Methods toException :: NestedAtomically -> SomeException # fromException :: SomeException -> Maybe NestedAtomically # displayException :: NestedAtomically -> String # | |
Show NestedAtomically | |
Defined in Control.Exception.Base Methods showsPrec :: Int -> NestedAtomically -> ShowS show :: NestedAtomically -> String showList :: [NestedAtomically] -> ShowS |
newtype NoMethodError #
Constructors
NoMethodError String |
Instances
Exception NoMethodError | |
Defined in Control.Exception.Base Methods toException :: NoMethodError -> SomeException # fromException :: SomeException -> Maybe NoMethodError # displayException :: NoMethodError -> String # | |
Show NoMethodError | |
Defined in Control.Exception.Base Methods showsPrec :: Int -> NoMethodError -> ShowS show :: NoMethodError -> String showList :: [NoMethodError] -> ShowS |
data NonTermination #
Constructors
NonTermination |
Instances
Exception NonTermination | |
Defined in Control.Exception.Base Methods toException :: NonTermination -> SomeException # fromException :: SomeException -> Maybe NonTermination # displayException :: NonTermination -> String # | |
Show NonTermination | |
Defined in Control.Exception.Base Methods showsPrec :: Int -> NonTermination -> ShowS show :: NonTermination -> String showList :: [NonTermination] -> ShowS |
newtype PatternMatchFail #
Constructors
PatternMatchFail String |
Instances
Exception PatternMatchFail | |
Defined in Control.Exception.Base Methods toException :: PatternMatchFail -> SomeException # fromException :: SomeException -> Maybe PatternMatchFail # displayException :: PatternMatchFail -> String # | |
Show PatternMatchFail | |
Defined in Control.Exception.Base Methods showsPrec :: Int -> PatternMatchFail -> ShowS show :: PatternMatchFail -> String showList :: [PatternMatchFail] -> ShowS |
newtype RecConError #
Constructors
RecConError String |
Instances
Exception RecConError | |
Defined in Control.Exception.Base Methods toException :: RecConError -> SomeException # fromException :: SomeException -> Maybe RecConError # displayException :: RecConError -> String # | |
Show RecConError | |
Defined in Control.Exception.Base Methods showsPrec :: Int -> RecConError -> ShowS show :: RecConError -> String showList :: [RecConError] -> ShowS |
newtype RecSelError #
Constructors
RecSelError String |
Instances
Exception RecSelError | |
Defined in Control.Exception.Base Methods toException :: RecSelError -> SomeException # fromException :: SomeException -> Maybe RecSelError # displayException :: RecSelError -> String # | |
Show RecSelError | |
Defined in Control.Exception.Base Methods showsPrec :: Int -> RecSelError -> ShowS show :: RecSelError -> String showList :: [RecSelError] -> ShowS |
newtype RecUpdError #
Constructors
RecUpdError String |
Instances
Exception RecUpdError | |
Defined in Control.Exception.Base Methods toException :: RecUpdError -> SomeException # fromException :: SomeException -> Maybe RecUpdError # displayException :: RecUpdError -> String # | |
Show RecUpdError | |
Defined in Control.Exception.Base Methods showsPrec :: Int -> RecUpdError -> ShowS show :: RecUpdError -> String showList :: [RecUpdError] -> ShowS |
Constructors
TypeError String |
Instances
Exception TypeError | |
Defined in Control.Exception.Base Methods toException :: TypeError -> SomeException # fromException :: SomeException -> Maybe TypeError # displayException :: TypeError -> String # | |
Show TypeError | |
bracketOnError :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c #
handleJust :: Exception e => (e -> Maybe b) -> (b -> IO a) -> IO a -> IO a #
mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a #
onException :: IO a -> IO b -> IO a #
Constructors
ErrorCallWithLocation String String |
Instances
Exception ErrorCall | |
Defined in GHC.Exception Methods toException :: ErrorCall -> SomeException # fromException :: SomeException -> Maybe ErrorCall # displayException :: ErrorCall -> String # | |
Show ErrorCall | |
Eq ErrorCall | |
Ord ErrorCall | |
Defined in GHC.Exception |
data ArithException #
Instances
Exception ArithException | |
Defined in GHC.Exception.Type Methods toException :: ArithException -> SomeException # fromException :: SomeException -> Maybe ArithException # displayException :: ArithException -> String # | |
Show ArithException | |
Defined in GHC.Exception.Type Methods showsPrec :: Int -> ArithException -> ShowS show :: ArithException -> String showList :: [ArithException] -> ShowS | |
Eq ArithException | |
Defined in GHC.Exception.Type Methods (==) :: ArithException -> ArithException -> Bool (/=) :: ArithException -> ArithException -> Bool | |
Ord ArithException | |
Defined in GHC.Exception.Type Methods compare :: ArithException -> ArithException -> Ordering (<) :: ArithException -> ArithException -> Bool (<=) :: ArithException -> ArithException -> Bool (>) :: ArithException -> ArithException -> Bool (>=) :: ArithException -> ArithException -> Bool max :: ArithException -> ArithException -> ArithException min :: ArithException -> ArithException -> ArithException |
data SomeException #
Constructors
Exception e => SomeException e |
Instances
Exception SomeException | |
Defined in GHC.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # | |
Show SomeException | |
Defined in GHC.Exception.Type Methods showsPrec :: Int -> SomeException -> ShowS show :: SomeException -> String showList :: [SomeException] -> ShowS |
data MaskingState #
Constructors
Unmasked | |
MaskedInterruptible | |
MaskedUninterruptible |
Instances
Show MaskingState | |
Defined in GHC.IO Methods showsPrec :: Int -> MaskingState -> ShowS show :: MaskingState -> String showList :: [MaskingState] -> ShowS | |
Eq MaskingState | |
Defined in GHC.IO |
getMaskingState :: IO MaskingState #
uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #
uninterruptibleMask_ :: IO a -> IO a #
data AllocationLimitExceeded #
Constructors
AllocationLimitExceeded |
Instances
Exception AllocationLimitExceeded | |
Defined in GHC.IO.Exception Methods toException :: AllocationLimitExceeded -> SomeException # fromException :: SomeException -> Maybe AllocationLimitExceeded # displayException :: AllocationLimitExceeded -> String # | |
Show AllocationLimitExceeded | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> AllocationLimitExceeded -> ShowS show :: AllocationLimitExceeded -> String showList :: [AllocationLimitExceeded] -> ShowS |
data ArrayException #
Constructors
IndexOutOfBounds String | |
UndefinedElement String |
Instances
Exception ArrayException | |
Defined in GHC.IO.Exception Methods toException :: ArrayException -> SomeException # fromException :: SomeException -> Maybe ArrayException # displayException :: ArrayException -> String # | |
Show ArrayException | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> ArrayException -> ShowS show :: ArrayException -> String showList :: [ArrayException] -> ShowS | |
Eq ArrayException | |
Defined in GHC.IO.Exception Methods (==) :: ArrayException -> ArrayException -> Bool (/=) :: ArrayException -> ArrayException -> Bool | |
Ord ArrayException | |
Defined in GHC.IO.Exception Methods compare :: ArrayException -> ArrayException -> Ordering (<) :: ArrayException -> ArrayException -> Bool (<=) :: ArrayException -> ArrayException -> Bool (>) :: ArrayException -> ArrayException -> Bool (>=) :: ArrayException -> ArrayException -> Bool max :: ArrayException -> ArrayException -> ArrayException min :: ArrayException -> ArrayException -> ArrayException |
newtype AssertionFailed #
Constructors
AssertionFailed String |
Instances
Exception AssertionFailed | |
Defined in GHC.IO.Exception Methods toException :: AssertionFailed -> SomeException # fromException :: SomeException -> Maybe AssertionFailed # displayException :: AssertionFailed -> String # | |
Show AssertionFailed | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> AssertionFailed -> ShowS show :: AssertionFailed -> String showList :: [AssertionFailed] -> ShowS |
data AsyncException #
Constructors
StackOverflow | |
HeapOverflow | |
ThreadKilled | |
UserInterrupt |
Instances
Exception AsyncException | |
Defined in GHC.IO.Exception Methods toException :: AsyncException -> SomeException # fromException :: SomeException -> Maybe AsyncException # displayException :: AsyncException -> String # | |
Show AsyncException | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> AsyncException -> ShowS show :: AsyncException -> String showList :: [AsyncException] -> ShowS | |
Eq AsyncException | |
Defined in GHC.IO.Exception Methods (==) :: AsyncException -> AsyncException -> Bool (/=) :: AsyncException -> AsyncException -> Bool | |
Ord AsyncException | |
Defined in GHC.IO.Exception Methods compare :: AsyncException -> AsyncException -> Ordering (<) :: AsyncException -> AsyncException -> Bool (<=) :: AsyncException -> AsyncException -> Bool (>) :: AsyncException -> AsyncException -> Bool (>=) :: AsyncException -> AsyncException -> Bool max :: AsyncException -> AsyncException -> AsyncException min :: AsyncException -> AsyncException -> AsyncException |
data BlockedIndefinitelyOnMVar #
Constructors
BlockedIndefinitelyOnMVar |
Instances
Exception BlockedIndefinitelyOnMVar | |
Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnMVar -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnMVar # displayException :: BlockedIndefinitelyOnMVar -> String # | |
Show BlockedIndefinitelyOnMVar | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnMVar -> ShowS show :: BlockedIndefinitelyOnMVar -> String showList :: [BlockedIndefinitelyOnMVar] -> ShowS |
data BlockedIndefinitelyOnSTM #
Constructors
BlockedIndefinitelyOnSTM |
Instances
Exception BlockedIndefinitelyOnSTM | |
Defined in GHC.IO.Exception Methods toException :: BlockedIndefinitelyOnSTM -> SomeException # fromException :: SomeException -> Maybe BlockedIndefinitelyOnSTM # displayException :: BlockedIndefinitelyOnSTM -> String # | |
Show BlockedIndefinitelyOnSTM | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS show :: BlockedIndefinitelyOnSTM -> String showList :: [BlockedIndefinitelyOnSTM] -> ShowS |
newtype CompactionFailed #
Constructors
CompactionFailed String |
Instances
Exception CompactionFailed | |
Defined in GHC.IO.Exception Methods toException :: CompactionFailed -> SomeException # fromException :: SomeException -> Maybe CompactionFailed # displayException :: CompactionFailed -> String # | |
Show CompactionFailed | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> CompactionFailed -> ShowS show :: CompactionFailed -> String showList :: [CompactionFailed] -> ShowS |
Constructors
Deadlock |
Instances
Exception Deadlock | |
Defined in GHC.IO.Exception Methods toException :: Deadlock -> SomeException # fromException :: SomeException -> Maybe Deadlock # displayException :: Deadlock -> String # | |
Show Deadlock | |
data IOException #
Instances
Exception IOException | |
Defined in GHC.IO.Exception Methods toException :: IOException -> SomeException # fromException :: SomeException -> Maybe IOException # displayException :: IOException -> String # | |
Show IOException | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOException -> ShowS show :: IOException -> String showList :: [IOException] -> ShowS | |
Eq IOException | |
Defined in GHC.IO.Exception |
data SomeAsyncException #
Constructors
Exception e => SomeAsyncException e |
Instances
Exception SomeAsyncException | |
Defined in GHC.IO.Exception Methods toException :: SomeAsyncException -> SomeException # fromException :: SomeException -> Maybe SomeAsyncException # displayException :: SomeAsyncException -> String # | |
Show SomeAsyncException | |
Defined in GHC.IO.Exception Methods showsPrec :: Int -> SomeAsyncException -> ShowS show :: SomeAsyncException -> String showList :: [SomeAsyncException] -> ShowS |
asyncExceptionFromException :: Exception e => SomeException -> Maybe e #
asyncExceptionToException :: Exception e => e -> SomeException #
allowInterrupt :: IO () #