e794ab154c04b8615508a90a6cdc8ff0804135fa
[ghc-base.git] / System / IO / Unsafe.hs
1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
3 -- |
4 -- Module      :  System.IO.Unsafe
5 -- Copyright   :  (c) The University of Glasgow 2001
6 -- License     :  BSD-style (see the file libraries/base/LICENSE)
7 -- 
8 -- Maintainer  :  libraries@haskell.org
9 -- Stability   :  provisional
10 -- Portability :  portable
11 --
12 -- \"Unsafe\" IO operations.
13 --
14 -----------------------------------------------------------------------------
15
16 module System.IO.Unsafe (
17    -- * Unsafe 'IO' operations
18    unsafePerformIO,     -- :: IO a -> a
19    unsafeInterleaveIO,  -- :: IO a -> IO a
20   ) where
21
22 #ifdef __GLASGOW_HASKELL__
23 import GHC.IOBase (unsafePerformIO, unsafeInterleaveIO)
24 #endif
25
26 #ifdef __HUGS__
27 import Hugs.IOExts (unsafePerformIO)
28 #endif
29
30 #ifdef __NHC__
31 import NHC.Internal (unsafePerformIO)
32 #endif
33
34 #ifndef __GLASGOW_HASKELL__
35 unsafeInterleaveIO :: IO a -> IO a
36 unsafeInterleaveIO f = return (unsafePerformIO f)
37 #endif