X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FSTRef.hs;h=288cbe778fd6db86bd16576e36dace138524f8a4;hb=3efe74f3acd0dff20d078b6e8416664193b219d4;hp=a13bc5682f55f075562dcb06e95e5ac92a99e825;hpb=acd78d6dbda0108ffa899cb585114a21c5ed7499;p=ghc-base.git diff --git a/Data/STRef.hs b/Data/STRef.hs index a13bc56..288cbe7 100644 --- a/Data/STRef.hs +++ b/Data/STRef.hs @@ -6,19 +6,19 @@ -- -- Maintainer : libraries@haskell.org -- Stability : experimental --- Portability : non-portable (requires non-portable module ST) +-- Portability : non-portable (uses Control.Monad.ST) -- -- Mutable references in the (strict) ST monad. -- ----------------------------------------------------------------------------- module Data.STRef ( - -- * STRefs - STRef, -- abstract, instance Eq - newSTRef, -- :: a -> ST s (STRef s a) - readSTRef, -- :: STRef s a -> ST s a - writeSTRef, -- :: STRef s a -> a -> ST s () - modifySTRef -- :: STRef s a -> (a -> a) -> ST s () + -- * STRefs + STRef, -- abstract, instance Eq + newSTRef, -- :: a -> ST s (STRef s a) + readSTRef, -- :: STRef s a -> ST s a + writeSTRef, -- :: STRef s a -> a -> ST s () + modifySTRef -- :: STRef s a -> (a -> a) -> ST s () ) where import Prelude @@ -30,12 +30,11 @@ import GHC.STRef #ifdef __HUGS__ import Hugs.ST -#endif - -import Data.Dynamic +import Data.Typeable #include "Typeable.h" INSTANCE_TYPEABLE2(STRef,stRefTc,"STRef") +#endif -- |Mutate the contents of an 'STRef' modifySTRef :: STRef s a -> (a -> a) -> ST s ()