[project @ 1999-11-18 17:32:38 by sewardj]
authorsewardj <unknown>
Thu, 18 Nov 1999 17:32:38 +0000 (17:32 +0000)
committersewardj <unknown>
Thu, 18 Nov 1999 17:32:38 +0000 (17:32 +0000)
Export Ref, newRef, readRef, writeRef from the Prelude.

ghc/interpreter/lib/Prelude.hs
ghc/lib/hugs/Prelude.hs

index e2261b0..940b1ad 100644 (file)
@@ -106,6 +106,9 @@ module Prelude (
     , MVar, newEmptyMVar, newMVar, putMVar, takeMVar, readMVar, swapMVar
     , ThreadId, forkIO
     ,trace
+
+    , Ref, newRef, readRef, writeRef
+
     -- Arrrggghhh!!! Help! Help! Help!
     -- What?!  Prelude.hs doesn't even _define_ most of these things!
     ,primCompAux,PrimArray,primRunST,primNewArray,primWriteArray
@@ -1890,6 +1893,13 @@ data Ref                  s a -- mutable variables
 data PrimMutableArray     s a -- mutable arrays with Int indices
 data PrimMutableByteArray s
 
+newRef   :: a -> ST s (Ref s a)
+newRef    = primNewRef
+readRef  :: Ref s a -> ST s a
+readRef   = primReadRef
+writeRef :: Ref s a -> a -> ST s ()
+writeRef  = primWriteRef
+
 
 ------------------------------------------------------------------------------
 -- ThreadId, MVar, concurrency stuff -----------------------------------------
index e2261b0..940b1ad 100644 (file)
@@ -106,6 +106,9 @@ module Prelude (
     , MVar, newEmptyMVar, newMVar, putMVar, takeMVar, readMVar, swapMVar
     , ThreadId, forkIO
     ,trace
+
+    , Ref, newRef, readRef, writeRef
+
     -- Arrrggghhh!!! Help! Help! Help!
     -- What?!  Prelude.hs doesn't even _define_ most of these things!
     ,primCompAux,PrimArray,primRunST,primNewArray,primWriteArray
@@ -1890,6 +1893,13 @@ data Ref                  s a -- mutable variables
 data PrimMutableArray     s a -- mutable arrays with Int indices
 data PrimMutableByteArray s
 
+newRef   :: a -> ST s (Ref s a)
+newRef    = primNewRef
+readRef  :: Ref s a -> ST s a
+readRef   = primReadRef
+writeRef :: Ref s a -> a -> ST s ()
+writeRef  = primWriteRef
+
 
 ------------------------------------------------------------------------------
 -- ThreadId, MVar, concurrency stuff -----------------------------------------