[project @ 2002-04-24 16:31:37 by simonmar]
[ghc-base.git] / Data / STRef.hs
1 -----------------------------------------------------------------------------
2 -- |
3 -- Module      :  Data.STRef
4 -- Copyright   :  (c) The University of Glasgow 2001
5 -- License     :  BSD-style (see the file libraries/core/LICENSE)
6 -- 
7 -- Maintainer  :  libraries@haskell.org
8 -- Stability   :  experimental
9 -- Portability :  non-portable (requires non-portable module ST)
10 --
11 -- $Id: STRef.hs,v 1.4 2002/04/24 16:31:40 simonmar Exp $
12 --
13 -- Mutable references in the ST monad.
14 --
15 -----------------------------------------------------------------------------
16
17 module Data.STRef (
18         STRef,          -- abstract, instance Eq
19         newSTRef,       -- :: a -> ST s (STRef s a)
20         readSTRef,      -- :: STRef s a -> ST s a
21         writeSTRef,     -- :: STRef s a -> a -> ST s ()
22         modifySTRef     -- :: STRef s a -> (a -> a) -> ST s ()
23  ) where
24
25 import Prelude
26
27 #ifdef __GLASGOW_HASKELL__
28 import GHC.STRef
29 #endif
30
31 import Data.Dynamic
32
33 #include "Dynamic.h"
34 INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef")