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