projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 1997-12-17 11:21:44 by simonm]
[ghc-hetmet.git]
/
ghc
/
lib
/
glaExts
/
LazyST.lhs
diff --git
a/ghc/lib/glaExts/LazyST.lhs
b/ghc/lib/glaExts/LazyST.lhs
index
3d457ca
..
d18b716
100644
(file)
--- a/
ghc/lib/glaExts/LazyST.lhs
+++ b/
ghc/lib/glaExts/LazyST.lhs
@@
-12,6
+12,7
@@
module LazyST (
ST,
ST,
+ runST,
unsafeInterleaveST,
-- ST is one, so you'll likely need some Monad bits
unsafeInterleaveST,
-- ST is one, so you'll likely need some Monad bits
@@
-35,6
+36,7
@@
import qualified UnsafeST ( unsafeInterleaveST )
import PrelBase ( Eq(..), Int, Bool, ($), ()(..) )
import Monad
import Ix
import PrelBase ( Eq(..), Int, Bool, ($), ()(..) )
import Monad
import Ix
+import GHC
newtype ST s a = ST (STBase.State s -> (a,STBase.State s))
newtype ST s a = ST (STBase.State s -> (a,STBase.State s))
@@
-50,6
+52,10
@@
instance Monad (ST s) where
ST k_a = k r
in
k_a new_s
ST k_a = k r
in
k_a new_s
+
+-- ToDo: un-inline this, it could cause problems...
+runST :: (All s => ST s a) -> a
+runST st = case st of ST st -> let (r,_) = st (STBase.S# realWorld#) in r
\end{code}
%*********************************************************
\end{code}
%*********************************************************