1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# OPTIONS_HADDOCK hide #-}
4 -----------------------------------------------------------------------------
7 -- Copyright : (c) The University of Glasgow 1994-2009
8 -- License : see libraries/base/LICENSE
10 -- Maintainer : cvs-ghc@haskell.org
11 -- Stability : internal
12 -- Portability : non-portable (GHC Extensions)
14 -- Backwards-compatibility interface
16 -----------------------------------------------------------------------------
19 module GHC.IOBase {-# DEPRECATED "use GHC.IO instead" #-} (
20 IO(..), unIO, failIO, liftIO, bindIO, thenIO, returnIO,
21 unsafePerformIO, unsafeInterleaveIO,
22 unsafeDupablePerformIO, unsafeDupableInterleaveIO,
25 -- To and from from ST
26 stToIO, ioToST, unsafeIOToST, unsafeSTToIO,
29 IORef(..), newIORef, readIORef, writeIORef,
30 IOArray(..), newIOArray, readIOArray, writeIOArray, unsafeReadIOArray, unsafeWriteIOArray,
33 -- Handles, file descriptors,
35 Handle(..), Handle__(..), HandleType(..), IOMode(..), FD,
36 isReadableHandleType, isWritableHandleType, isReadWriteHandleType, showHandle,
39 -- Buffer(..), RawBuffer, BufferState(..),
40 BufferList(..), BufferMode(..),
41 --bufferIsWritable, bufferEmpty, bufferFull,
44 Exception(..), ArithException(..), AsyncException(..), ArrayException(..),
45 stackOverflow, heapOverflow, ioException,
46 IOError, IOException(..), IOErrorType(..), ioError, userError,
48 throwIO, block, unblock, blocked, catchAny, catchException,
50 ErrorCall(..), AssertionFailed(..), assertError, untangle,
51 BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..),
52 blockedOnDeadMVar, blockedIndefinitely
58 import GHC.IO.Handle.Types
60 import GHC.IO.Exception
64 import Foreign.C.Types
70 -- Backwards compat: this was renamed to BlockedIndefinitelyOnMVar
71 data BlockedOnDeadMVar = BlockedOnDeadMVar
74 instance Exception BlockedOnDeadMVar
76 instance Show BlockedOnDeadMVar where
77 showsPrec _ BlockedOnDeadMVar = showString "thread blocked indefinitely"
79 blockedOnDeadMVar :: SomeException -- for the RTS
80 blockedOnDeadMVar = toException BlockedOnDeadMVar
83 -- Backwards compat: this was renamed to BlockedIndefinitelyOnSTM
84 data BlockedIndefinitely = BlockedIndefinitely
87 instance Exception BlockedIndefinitely
89 instance Show BlockedIndefinitely where
90 showsPrec _ BlockedIndefinitely = showString "thread blocked indefinitely"
92 blockedIndefinitely :: SomeException -- for the RTS
93 blockedIndefinitely = toException BlockedIndefinitely