ST,
+ runST,
unsafeInterleaveST,
-- ST is one, so you'll likely need some Monad bits
import PrelBase ( Eq(..), Int, Bool, ($), ()(..) )
import Monad
import Ix
+import GHC
newtype ST s a = ST (STBase.State s -> (a,STBase.State 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}
%*********************************************************