[project @ 2002-07-16 16:08:58 by ross]
[packages/old-locale.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 (strict) ST monad.
12 --
13 -----------------------------------------------------------------------------
14
15 module Data.STRef (
16 -- * STRefs
17 STRef, -- abstract, instance Eq
18 newSTRef, -- :: a -> ST s (STRef s a)
19 readSTRef, -- :: STRef s a -> ST s a
20 writeSTRef, -- :: STRef s a -> a -> ST s ()
21 modifySTRef -- :: STRef s a -> (a -> a) -> ST s ()
22 ) where
23
24 import Prelude
25
26 #ifdef __GLASGOW_HASKELL__
27 import GHC.STRef
28 #endif
29
30 #ifdef __HUGS__
31 import Hugs.ST
32 #endif
33
34 import Data.Dynamic
35
36 #include "Dynamic.h"
37 INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef")