[project @ 2002-05-09 13:16:29 by simonmar]
[packages/random.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/base/LICENSE)
6 --
7 -- Maintainer : libraries@haskell.org
8 -- Stability : experimental
9 -- Portability : non-portable (requires non-portable module ST)
10 --
11 -- Mutable references in the ST monad.
12 --
13 -----------------------------------------------------------------------------
14
15 module Data.STRef (
16 STRef, -- abstract, instance Eq
17 newSTRef, -- :: a -> ST s (STRef s a)
18 readSTRef, -- :: STRef s a -> ST s a
19 writeSTRef, -- :: STRef s a -> a -> ST s ()
20 modifySTRef -- :: STRef s a -> (a -> a) -> ST s ()
21 ) where
22
23 import Prelude
24
25 #ifdef __GLASGOW_HASKELL__
26 import GHC.STRef
27 #endif
28
29 import Data.Dynamic
30
31 #include "Dynamic.h"
32 INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef")