5b9410443244f02878c43e4c1c05e8a0599b0557
[ghc-base.git] / Foreign / StablePtr.hs
1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
3 -- 
4 -- Module      :  Foreign.StablePtr
5 -- Copyright   :  (c) The University of Glasgow 2001
6 -- License     :  BSD-style (see the file libraries/core/LICENSE)
7 -- 
8 -- Maintainer  :  ffi@haskell.org
9 -- Stability   :  experimental
10 -- Portability :  non-portable
11 --
12 -- $Id: StablePtr.hs,v 1.1 2001/06/28 14:15:03 simonmar Exp $
13 --
14 -- Stable pointers.
15 --
16 -----------------------------------------------------------------------------
17
18 module Foreign.StablePtr
19         ( StablePtr,         -- abstract
20         , newStablePtr       -- :: a -> IO (StablePtr a)
21         , deRefStablePtr     -- :: StablePtr a -> IO a
22         , freeStablePtr      -- :: StablePtr a -> IO ()
23         , castStablePtrToPtr -- :: StablePtr a -> Ptr ()
24         , castPtrToStablePtr -- :: Ptr () -> StablePtr a
25         ) where
26
27 import Data.Dynamic
28
29 #ifdef __GLASGOW_HASKELL__
30 import GHC.Stable
31 import GHC.Err
32 #endif
33
34 #include "Dynamic.h"
35 INSTANCE_TYPEABLE1(StablePtr,stablePtrTc,"StablePtr")