Move the instances of Functor and Monad IO to GHC.Base, to avoid orphans
[ghc-base.git] / GHC / IOBase.hs
1 {-# OPTIONS_HADDOCK hide #-}
2 -----------------------------------------------------------------------------
3 -- |
4 -- Module      :  GHC.IOBase
5 -- Copyright   :  (c) The University of Glasgow 1994-2009
6 -- License     :  see libraries/base/LICENSE
7 -- 
8 -- Maintainer  :  cvs-ghc@haskell.org
9 -- Stability   :  internal
10 -- Portability :  non-portable (GHC Extensions)
11 --
12 -- Backwards-compatibility interface
13 --
14 -----------------------------------------------------------------------------
15
16
17 module GHC.IOBase {-# DEPRECATED "use GHC.IO instead" #-} (
18     IO(..), unIO, failIO, liftIO, bindIO, thenIO, returnIO, 
19     unsafePerformIO, unsafeInterleaveIO,
20     unsafeDupablePerformIO, unsafeDupableInterleaveIO,
21     noDuplicate,
22
23         -- To and from from ST
24     stToIO, ioToST, unsafeIOToST, unsafeSTToIO,
25
26         -- References
27     IORef(..), newIORef, readIORef, writeIORef, 
28     IOArray(..), newIOArray, readIOArray, writeIOArray, unsafeReadIOArray, unsafeWriteIOArray,
29     MVar(..),
30
31         -- Handles, file descriptors,
32     FilePath,  
33     Handle(..), Handle__(..), HandleType(..), IOMode(..), FD, 
34     isReadableHandleType, isWritableHandleType, isReadWriteHandleType, showHandle,
35
36         -- Buffers
37     -- Buffer(..), RawBuffer, BufferState(..), 
38     BufferList(..), BufferMode(..),
39     --bufferIsWritable, bufferEmpty, bufferFull, 
40
41         -- Exceptions
42     Exception(..), ArithException(..), AsyncException(..), ArrayException(..),
43     stackOverflow, heapOverflow, ioException, 
44     IOError, IOException(..), IOErrorType(..), ioError, userError,
45     ExitCode(..),
46     throwIO, block, unblock, blocked, catchAny, catchException,
47     evaluate,
48     ErrorCall(..), AssertionFailed(..), assertError, untangle,
49     BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..),
50     blockedOnDeadMVar, blockedIndefinitely
51   ) where
52
53 import GHC.Base
54 import GHC.Exception
55 import GHC.IO
56 import GHC.IO.Handle.Types
57 import GHC.IO.IOMode
58 import GHC.IO.Exception
59 import GHC.IOArray
60 import GHC.IORef
61 import GHC.MVar
62 import Foreign.C.Types
63
64 type FD = CInt