SafeHaskell: Added SafeHaskell to base
[ghc.git] / libraries / base / Foreign.hs
1 #if sh_SAFE_DEFAULT
2 {-# LANGUAGE Trustworthy #-}
3 #endif
4 {-# LANGUAGE NoImplicitPrelude #-}
5
6 -----------------------------------------------------------------------------
7 -- |
8 -- Module : Foreign
9 -- Copyright : (c) The FFI task force 2001
10 -- License : BSD-style (see the file libraries/base/LICENSE)
11 --
12 -- Maintainer : ffi@haskell.org
13 -- Stability : provisional
14 -- Portability : portable
15 --
16 -- A collection of data types, classes, and functions for interfacing
17 -- with another programming language.
18 --
19 -----------------------------------------------------------------------------
20
21 module Foreign
22 ( module Data.Bits
23 , module Data.Int
24 , module Data.Word
25 , module Foreign.Ptr
26 , module Foreign.ForeignPtr
27 , module Foreign.StablePtr
28 , module Foreign.Storable
29 , module Foreign.Marshal
30
31 #if !sh_SAFE_DEFAULT
32 -- * Unsafe Functions
33
34 -- | 'unsafePerformIO' is exported here for backwards
35 -- compatibility reasons only. For doing local marshalling in
36 -- the FFI, use 'unsafeLocalState'. For other uses, see
37 -- 'System.IO.Unsafe.unsafePerformIO'.
38 , unsafePerformIO
39 #endif
40 ) where
41
42 import Data.Bits
43 import Data.Int
44 import Data.Word
45 import Foreign.Ptr
46 import Foreign.ForeignPtr
47 import Foreign.StablePtr
48 import Foreign.Storable
49 import Foreign.Marshal
50
51 #if !sh_SAFE_DEFAULT
52 import GHC.IO (IO)
53 import qualified System.IO.Unsafe (unsafePerformIO)
54
55 {-# DEPRECATED unsafePerformIO "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release" #-}
56
57 {-# INLINE unsafePerformIO #-}
58 unsafePerformIO :: IO a -> a
59 unsafePerformIO = System.IO.Unsafe.unsafePerformIO
60 #endif
61