From 140df6036ba2b57f9869e3ac96b0b00c09e85b7a Mon Sep 17 00:00:00 2001 From: sewardj <unknown> Date: Thu, 18 Nov 1999 17:32:38 +0000 Subject: [PATCH] [project @ 1999-11-18 17:32:38 by sewardj] Export Ref, newRef, readRef, writeRef from the Prelude. --- ghc/interpreter/lib/Prelude.hs | 10 ++++++++++ ghc/lib/hugs/Prelude.hs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/ghc/interpreter/lib/Prelude.hs b/ghc/interpreter/lib/Prelude.hs index e2261b08e100..940b1ad25cf0 100644 --- a/ghc/interpreter/lib/Prelude.hs +++ b/ghc/interpreter/lib/Prelude.hs @@ -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 ----------------------------------------- diff --git a/ghc/lib/hugs/Prelude.hs b/ghc/lib/hugs/Prelude.hs index e2261b08e100..940b1ad25cf0 100644 --- a/ghc/lib/hugs/Prelude.hs +++ b/ghc/lib/hugs/Prelude.hs @@ -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 ----------------------------------------- -- GitLab