Spec-Zone.ru › Haskell 9

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 Safe
Language Haskell2010

Description

IO-related Exception types and functions

The API of this module is unstable and not meant to be consumed by the general public. If you absolutely must depend on it, make sure to use a tight upper bound, e.g., base < 4.X rather than base < 5, because the interface can change rapidly without much warning.

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

BlockedIndefinitelyOnMVar
Instances
Instances details
Exception BlockedIndefinitelyOnMVar Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: BlockedIndefinitelyOnMVar -> SomeException Source

fromException :: SomeException -> Maybe BlockedIndefinitelyOnMVar Source

displayException :: BlockedIndefinitelyOnMVar -> String Source

backtraceDesired :: BlockedIndefinitelyOnMVar -> Bool Source

Show BlockedIndefinitelyOnMVar Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: 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 TVars involved, so it can't ever continue.

Constructors

BlockedIndefinitelyOnSTM
Instances
Instances details
Exception BlockedIndefinitelyOnSTM Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: BlockedIndefinitelyOnSTM -> SomeException Source

fromException :: SomeException -> Maybe BlockedIndefinitelyOnSTM Source

displayException :: BlockedIndefinitelyOnSTM -> String Source

backtraceDesired :: BlockedIndefinitelyOnSTM -> Bool Source

Show BlockedIndefinitelyOnSTM Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS Source

show :: BlockedIndefinitelyOnSTM -> String Source

showList :: [BlockedIndefinitelyOnSTM] -> ShowS Source

blockedIndefinitelyOnSTM :: SomeException Source

data Deadlock Source

There are no runnable threads, so the program is deadlocked. The Deadlock exception is raised in the main thread only.

Constructors

Deadlock
Instances
Instances details
Exception Deadlock Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: Deadlock -> SomeException Source

fromException :: SomeException -> Maybe Deadlock Source

displayException :: Deadlock -> String Source

backtraceDesired :: Deadlock -> Bool Source

Show Deadlock Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> Deadlock -> ShowS Source

show :: Deadlock -> String Source

showList :: [Deadlock] -> ShowS Source

data AllocationLimitExceeded Source

This thread has exceeded its allocation limit. See setAllocationCounter and enableAllocationLimit.

Since: base-4.8.0.0

Constructors

AllocationLimitExceeded
Instances
Instances details
Exception AllocationLimitExceeded Source

Since: base-4.8.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: AllocationLimitExceeded -> SomeException Source

fromException :: SomeException -> Maybe AllocationLimitExceeded Source

displayException :: AllocationLimitExceeded -> String Source

backtraceDesired :: AllocationLimitExceeded -> Bool Source

Show AllocationLimitExceeded Source

Since: base-4.7.1.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> AllocationLimitExceeded -> ShowS Source

show :: AllocationLimitExceeded -> String Source

showList :: [AllocationLimitExceeded] -> ShowS Source

allocationLimitExceeded :: SomeException Source

newtype AssertionFailed Source

assert was applied to False.

Constructors

AssertionFailed String
Instances
Instances details
Exception AssertionFailed Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: AssertionFailed -> SomeException Source

fromException :: SomeException -> Maybe AssertionFailed Source

displayException :: AssertionFailed -> String Source

backtraceDesired :: AssertionFailed -> Bool Source

Show AssertionFailed Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: 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

CompactionFailed String
Instances
Instances details
Exception CompactionFailed Source

Since: base-4.10.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: CompactionFailed -> SomeException Source

fromException :: SomeException -> Maybe CompactionFailed Source

displayException :: CompactionFailed -> String Source

backtraceDesired :: CompactionFailed -> Bool Source

Show CompactionFailed Source

Since: base-4.10.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: 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

Exception e => SomeAsyncException e
Instances
Instances details
Exception SomeAsyncException Source

Since: base-4.7.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: SomeAsyncException -> SomeException Source

fromException :: SomeException -> Maybe SomeAsyncException Source

displayException :: SomeAsyncException -> String Source

backtraceDesired :: SomeAsyncException -> Bool Source

Show SomeAsyncException Source

Since: base-4.7.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: 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:

  • It is undefined which thread receives this exception. GHC currently throws this to the same thread that receives UserInterrupt, but this may change in the future.
  • The GHC RTS currently can only recover from heap overflow if it detects that an explicit memory limit (set via RTS flags). has been exceeded. Currently, failure to allocate memory from the operating system results in immediate termination of the program.
ThreadKilled

This exception is raised by another thread calling killThread, or by the system if it needs to terminate the thread for some reason.

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
Instances details
Eq AsyncException Source

Since: base-4.2.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

(==) :: AsyncException -> AsyncException -> Bool Source

(/=) :: AsyncException -> AsyncException -> Bool Source

Ord AsyncException Source

Since: base-4.2.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

compare :: AsyncException -> AsyncException -> Ordering Source

(<) :: AsyncException -> AsyncException -> Bool Source

(<=) :: AsyncException -> AsyncException -> Bool Source

(>) :: AsyncException -> AsyncException -> Bool Source

(>=) :: AsyncException -> AsyncException -> Bool Source

max :: AsyncException -> AsyncException -> AsyncException Source

min :: AsyncException -> AsyncException -> AsyncException Source

Exception AsyncException Source

Since: base-4.7.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: AsyncException -> SomeException Source

fromException :: SomeException -> Maybe AsyncException Source

displayException :: AsyncException -> String Source

backtraceDesired :: AsyncException -> Bool Source

Show AsyncException Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> AsyncException -> ShowS Source

show :: AsyncException -> String Source

showList :: [AsyncException] -> ShowS Source

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
Instances details
Eq ArrayException Source

Since: base-4.2.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

(==) :: ArrayException -> ArrayException -> Bool Source

(/=) :: ArrayException -> ArrayException -> Bool Source

Ord ArrayException Source

Since: base-4.2.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

compare :: ArrayException -> ArrayException -> Ordering Source

(<) :: ArrayException -> ArrayException -> Bool Source

(<=) :: ArrayException -> ArrayException -> Bool Source

(>) :: ArrayException -> ArrayException -> Bool Source

(>=) :: ArrayException -> ArrayException -> Bool Source

max :: ArrayException -> ArrayException -> ArrayException Source

min :: ArrayException -> ArrayException -> ArrayException Source

Exception ArrayException Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: ArrayException -> SomeException Source

fromException :: SomeException -> Maybe ArrayException Source

displayException :: ArrayException -> String Source

backtraceDesired :: ArrayException -> Bool Source

Show ArrayException Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> ArrayException -> ShowS Source

show :: ArrayException -> String Source

showList :: [ArrayException] -> ShowS Source

data ExitCode Source

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
Instances details
Eq ExitCode Source
Instance details

Defined in GHC.Internal.IO.Exception

Methods

(==) :: ExitCode -> ExitCode -> Bool Source

(/=) :: ExitCode -> ExitCode -> Bool Source

Ord ExitCode Source
Instance details

Defined in GHC.Internal.IO.Exception

Methods

compare :: ExitCode -> ExitCode -> Ordering Source

(<) :: ExitCode -> ExitCode -> Bool Source

(<=) :: ExitCode -> ExitCode -> Bool Source

(>) :: ExitCode -> ExitCode -> Bool Source

(>=) :: ExitCode -> ExitCode -> Bool Source

max :: ExitCode -> ExitCode -> ExitCode Source

min :: ExitCode -> ExitCode -> ExitCode Source

Exception ExitCode Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: ExitCode -> SomeException Source

fromException :: SomeException -> Maybe ExitCode Source

displayException :: ExitCode -> String Source

backtraceDesired :: ExitCode -> Bool Source

Generic ExitCode Source
Instance details

Defined in GHC.Internal.IO.Exception

Associated Types

type Rep ExitCode
Instance details

Defined in GHC.Internal.IO.Exception

type Rep ExitCode = D1 ('MetaData "ExitCode" "GHC.Internal.IO.Exception" "ghc-internal" 'False) (C1 ('MetaCons "ExitSuccess" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExitFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

Methods

from :: ExitCode -> Rep ExitCode x Source

to :: Rep ExitCode x -> ExitCode Source

Read ExitCode Source
Instance details

Defined in GHC.Internal.IO.Exception

Methods

readsPrec :: Int -> ReadS ExitCode Source

readList :: ReadS [ExitCode] Source

readPrec :: ReadPrec ExitCode Source

readListPrec :: ReadPrec [ExitCode] Source

Show ExitCode Source
Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> ExitCode -> ShowS Source

show :: ExitCode -> String Source

showList :: [ExitCode] -> ShowS Source

type Rep ExitCode Source
Instance details

Defined in GHC.Internal.IO.Exception

type Rep ExitCode = D1 ('MetaData "ExitCode" "GHC.Internal.IO.Exception" "ghc-internal" '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

FixIOException
Instances
Instances details
Exception FixIOException Source

Since: base-4.11.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: FixIOException -> SomeException Source

fromException :: SomeException -> Maybe FixIOException Source

displayException :: FixIOException -> String Source

backtraceDesired :: FixIOException -> Bool Source

Show FixIOException Source

Since: base-4.11.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> FixIOException -> ShowS Source

show :: FixIOException -> String Source

showList :: [FixIOException] -> ShowS Source

ioException :: HasCallStack => IOException -> IO a Source

ioError :: HasCallStack => IOError -> IO a Source

Raise an IOError 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 IOError 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

  • ioe_handle :: Maybe Handle

    the handle used by the action flagging the error.

  • ioe_type :: IOErrorType

    what it was.

  • ioe_location :: String

    location.

  • ioe_description :: String

    error type specific information.

  • ioe_errno :: Maybe CInt

    errno leading to this error, if any.

  • ioe_filename :: Maybe FilePath

    filename the error is related to (some libraries may assume different encodings when constructing this field from e.g. ByteString or other types)

Instances
Instances details
Eq IOException Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

(==) :: IOException -> IOException -> Bool Source

(/=) :: IOException -> IOException -> Bool Source

Exception IOException Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

toException :: IOException -> SomeException Source

fromException :: SomeException -> Maybe IOException Source

displayException :: IOException -> String Source

backtraceDesired :: IOException -> Bool Source

Show IOException Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> IOException -> ShowS Source

show :: IOException -> String Source

showList :: [IOException] -> ShowS Source

data IOErrorType Source

An abstract type that contains a value for each variant of IOError.

Constructors

AlreadyExists
NoSuchThing
ResourceBusy
ResourceExhausted
EOF
IllegalOperation
PermissionDenied
UserError
UnsatisfiedConstraints
SystemError
ProtocolError
OtherError
InvalidArgument
InappropriateType
HardwareFault
UnsupportedOperation
TimeExpired
ResourceVanished
Interrupted
Instances
Instances details
Eq IOErrorType Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

(==) :: IOErrorType -> IOErrorType -> Bool Source

(/=) :: IOErrorType -> IOErrorType -> Bool Source

Show IOErrorType Source

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Exception

Methods

showsPrec :: Int -> IOErrorType -> ShowS Source

show :: IOErrorType -> String Source

showList :: [IOErrorType] -> ShowS Source

userError :: String -> IOError Source

Construct an IOError 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

unsupportedOperation :: IOError Source

untangle :: Addr# -> String -> String Source

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.14.1/docs/libraries/base-4.22.0.0-66f8/GHC-IO-Exception.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API