Use explicit language extensions & remove extension fields from base.cabal
[packages/base.git] / GHC / IOBase.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# OPTIONS_HADDOCK hide #-}
3
4 -----------------------------------------------------------------------------
5 -- |
6 -- Module : GHC.IOBase
7 -- Copyright : (c) The University of Glasgow 1994-2009
8 -- License : see libraries/base/LICENSE
9 --
10 -- Maintainer : cvs-ghc@haskell.org
11 -- Stability : internal
12 -- Portability : non-portable (GHC Extensions)
13 --
14 -- Backwards-compatibility interface
15 --
16 -----------------------------------------------------------------------------
17
18
19 module GHC.IOBase {-# DEPRECATED "use GHC.IO instead" #-} (
20 IO(..), unIO, failIO, liftIO, bindIO, thenIO, returnIO,
21 unsafePerformIO, unsafeInterleaveIO,
22 unsafeDupablePerformIO, unsafeDupableInterleaveIO,
23 noDuplicate,
24
25 -- To and from from ST
26 stToIO, ioToST, unsafeIOToST, unsafeSTToIO,
27
28 -- References
29 IORef(..), newIORef, readIORef, writeIORef,
30 IOArray(..), newIOArray, readIOArray, writeIOArray, unsafeReadIOArray, unsafeWriteIOArray,
31 MVar(..),
32
33 -- Handles, file descriptors,
34 FilePath,
35 Handle(..), Handle__(..), HandleType(..), IOMode(..), FD,
36 isReadableHandleType, isWritableHandleType, isReadWriteHandleType, showHandle,
37
38 -- Buffers
39 -- Buffer(..), RawBuffer, BufferState(..),
40 BufferList(..), BufferMode(..),
41 --bufferIsWritable, bufferEmpty, bufferFull,
42
43 -- Exceptions
44 Exception(..), ArithException(..), AsyncException(..), ArrayException(..),
45 stackOverflow, heapOverflow, ioException,
46 IOError, IOException(..), IOErrorType(..), ioError, userError,
47 ExitCode(..),
48 throwIO, block, unblock, blocked, catchAny, catchException,
49 evaluate,
50 ErrorCall(..), AssertionFailed(..), assertError, untangle,
51 BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..),
52 blockedOnDeadMVar, blockedIndefinitely
53 ) where
54
55 import GHC.Base
56 import GHC.Exception
57 import GHC.IO
58 import GHC.IO.Handle.Types
59 import GHC.IO.IOMode
60 import GHC.IO.Exception
61 import GHC.IOArray
62 import GHC.IORef
63 import GHC.MVar
64 import Foreign.C.Types
65 import GHC.Show
66 import Data.Typeable
67
68 type FD = CInt
69
70 -- Backwards compat: this was renamed to BlockedIndefinitelyOnMVar
71 data BlockedOnDeadMVar = BlockedOnDeadMVar
72 deriving Typeable
73
74 instance Exception BlockedOnDeadMVar
75
76 instance Show BlockedOnDeadMVar where
77 showsPrec _ BlockedOnDeadMVar = showString "thread blocked indefinitely"
78
79 blockedOnDeadMVar :: SomeException -- for the RTS
80 blockedOnDeadMVar = toException BlockedOnDeadMVar
81
82
83 -- Backwards compat: this was renamed to BlockedIndefinitelyOnSTM
84 data BlockedIndefinitely = BlockedIndefinitely
85 deriving Typeable
86
87 instance Exception BlockedIndefinitely
88
89 instance Show BlockedIndefinitely where
90 showsPrec _ BlockedIndefinitely = showString "thread blocked indefinitely"
91
92 blockedIndefinitely :: SomeException -- for the RTS
93 blockedIndefinitely = toException BlockedIndefinitely