On this page
GHC.IO.Exception
Copyright | (c) The University of Glasgow 2009 |
---|---|
License | see libraries/base/LICENSE |
Maintainer | libraries@haskell.org |
Stability | internal |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Description
IO-related Exception types and functions
data BlockedIndefinitelyOnMVar Source
The thread is blocked on an MVar
, but there are no other references to the MVar
so it can't ever continue.
Constructors
Instances
Exception BlockedIndefinitelyOnMVar Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception |
|
Show BlockedIndefinitelyOnMVar Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> BlockedIndefinitelyOnMVar -> ShowS Source show :: BlockedIndefinitelyOnMVar -> String Source showList :: [BlockedIndefinitelyOnMVar] -> ShowS Source |
blockedIndefinitelyOnMVar :: SomeException Source
data BlockedIndefinitelyOnSTM Source
The thread is waiting to retry an STM transaction, but there are no other references to any TVar
s involved, so it can't ever continue.
Constructors
Instances
Exception BlockedIndefinitelyOnSTM Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception |
|
Show BlockedIndefinitelyOnSTM Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS Source show :: BlockedIndefinitelyOnSTM -> String Source showList :: [BlockedIndefinitelyOnSTM] -> ShowS Source |
blockedIndefinitelyOnSTM :: SomeException Source
There are no runnable threads, so the program is deadlocked. The Deadlock
exception is raised in the main thread only.
Constructors
Instances
Exception Deadlock Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodstoException :: Deadlock -> SomeException Source fromException :: SomeException -> Maybe Deadlock Source displayException :: Deadlock -> String Source |
|
Show Deadlock Source | Since: base-4.1.0.0 |
data AllocationLimitExceeded Source
This thread has exceeded its allocation limit. See setAllocationCounter
and enableAllocationLimit
.
Since: base-4.8.0.0
Constructors
Instances
Exception AllocationLimitExceeded Source | Since: base-4.8.0.0 |
Defined in GHC.IO.Exception |
|
Show AllocationLimitExceeded Source | Since: base-4.7.1.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> AllocationLimitExceeded -> ShowS Source show :: AllocationLimitExceeded -> String Source showList :: [AllocationLimitExceeded] -> ShowS Source |
allocationLimitExceeded :: SomeException Source
newtype AssertionFailed Source
Constructors
Instances
Exception AssertionFailed Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodstoException :: AssertionFailed -> SomeException Source fromException :: SomeException -> Maybe AssertionFailed Source |
|
Show AssertionFailed Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> AssertionFailed -> ShowS Source show :: AssertionFailed -> String Source showList :: [AssertionFailed] -> ShowS Source |
newtype CompactionFailed Source
Compaction found an object that cannot be compacted. Functions cannot be compacted, nor can mutable objects or pinned objects. See compact
.
Since: base-4.10.0.0
Constructors
Instances
Exception CompactionFailed Source | Since: base-4.10.0.0 |
Defined in GHC.IO.Exception MethodstoException :: CompactionFailed -> SomeException Source fromException :: SomeException -> Maybe CompactionFailed Source |
|
Show CompactionFailed Source | Since: base-4.10.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> CompactionFailed -> ShowS Source show :: CompactionFailed -> String Source showList :: [CompactionFailed] -> ShowS Source |
cannotCompactFunction :: SomeException Source
cannotCompactPinned :: SomeException Source
cannotCompactMutable :: SomeException Source
data SomeAsyncException Source
Superclass for asynchronous exceptions.
Since: base-4.7.0.0
Constructors
forall e.Exception e => SomeAsyncException e |
Instances
Exception SomeAsyncException Source | Since: base-4.7.0.0 |
Defined in GHC.IO.Exception MethodstoException :: SomeAsyncException -> SomeException Source fromException :: SomeException -> Maybe SomeAsyncException Source |
|
Show SomeAsyncException Source | Since: base-4.7.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> SomeAsyncException -> ShowS Source show :: SomeAsyncException -> String Source showList :: [SomeAsyncException] -> ShowS Source |
asyncExceptionToException :: Exception e => e -> SomeException Source
Since: base-4.7.0.0
asyncExceptionFromException :: Exception e => SomeException -> Maybe e Source
Since: base-4.7.0.0
data AsyncException Source
Asynchronous exceptions.
Constructors
StackOverflow | The current thread's stack exceeded its limit. Since an exception has been raised, the thread's stack will certainly be below its limit again, but the programmer should take remedial action immediately. |
HeapOverflow | The program's heap is reaching its limit, and the program should take action to reduce the amount of live data it has. Notes:
|
ThreadKilled | This exception is raised by another thread calling |
UserInterrupt | This exception is raised by default in the main thread of the program when the user requests to terminate the program via the usual mechanism(s) (e.g. Control-C in the console). |
Instances
stackOverflow :: SomeException Source
heapOverflow :: SomeException Source
data ArrayException Source
Exceptions generated by array operations
Constructors
IndexOutOfBounds String | An attempt was made to index an array outside its declared bounds. |
UndefinedElement String | An attempt was made to evaluate an element of an array that had not been initialized. |
Instances
Defines the exit codes that a program can return.
Constructors
ExitSuccess | indicates successful termination; |
ExitFailure Int | indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system). |
Instances
Exception ExitCode Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodstoException :: ExitCode -> SomeException Source fromException :: SomeException -> Maybe ExitCode Source displayException :: ExitCode -> String Source |
|
Generic ExitCode Source | |
Read ExitCode Source | |
Show ExitCode Source | |
Eq ExitCode Source | |
Ord ExitCode Source | |
Defined in GHC.IO.Exception |
|
type Rep ExitCode Source | |
Defined in GHC.IO.Exception
type Rep ExitCode = D1 ('MetaData "ExitCode" "GHC.IO.Exception" "base" 'False) (C1 ('MetaCons "ExitSuccess" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExitFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))
|
data FixIOException Source
The exception thrown when an infinite cycle is detected in fixIO
.
Since: base-4.11.0.0
Constructors
Instances
Exception FixIOException Source | Since: base-4.11.0.0 |
Defined in GHC.IO.Exception MethodstoException :: FixIOException -> SomeException Source fromException :: SomeException -> Maybe FixIOException Source |
|
Show FixIOException Source | Since: base-4.11.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> FixIOException -> ShowS Source show :: FixIOException -> String Source showList :: [FixIOException] -> ShowS Source |
ioException :: IOException -> IO a Source
ioError :: IOError -> IO a Source
Raise an IOException
in the IO
monad.
type IOError = IOException Source
The Haskell 2010 type for exceptions in the IO
monad. Any I/O operation may raise an IOException
instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Exception
.
In Haskell 2010, this is an opaque type.
data IOException Source
Exceptions that occur in the IO
monad. An IOException
records a more specific error type, a descriptive string and maybe the handle that was used when the error was flagged.
Constructors
IOError | |
Fields
|
Instances
Exception IOException Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodstoException :: IOException -> SomeException Source |
|
Show IOException Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> IOException -> ShowS Source show :: IOException -> String Source showList :: [IOException] -> ShowS Source |
|
Eq IOException Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception Methods(==) :: IOException -> IOException -> Bool Source (/=) :: IOException -> IOException -> Bool Source |
data IOErrorType Source
An abstract type that contains a value for each variant of IOException
.
Constructors
Instances
Show IOErrorType Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception MethodsshowsPrec :: Int -> IOErrorType -> ShowS Source show :: IOErrorType -> String Source showList :: [IOErrorType] -> ShowS Source |
|
Eq IOErrorType Source | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception Methods(==) :: IOErrorType -> IOErrorType -> Bool Source (/=) :: IOErrorType -> IOErrorType -> Bool Source |
userError :: String -> IOError Source
Construct an IOException
value with a string describing the error. The fail
method of the IO
instance of the Monad
class raises a userError
, thus:
instance Monad IO where
...
fail s = ioError (userError s)
assertError :: (?callStack :: CallStack) => Bool -> a -> a Source
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.4.2/docs/libraries/base-4.17.0.0/GHC-IO-Exception.html