+% ------------------------------------------------------------------------------
+% $Id: PrelST.lhs,v 1.20 2001/02/22 16:48:24 qrczak Exp $
%
-% (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
+% (c) The University of Glasgow, 1992-2000
%
+
\section[PrelST]{The @ST@ monad}
\begin{code}
module PrelST where
-import Monad
-import PrelShow
import PrelBase
-import PrelGHC
-import PrelNum () -- So that we get the .hi file for system imports
+import PrelShow
+import PrelNum
+
+default ()
\end{code}
%*********************************************************
liftST :: ST s a -> State# s -> STret s a
liftST (ST m) = \s -> case m s of (# s', r #) -> STret s' r
-fixST :: (a -> ST s a) -> ST s a
-fixST k = ST $ \ s ->
- let ans = liftST (k r) s
- STret _ r = ans
- in
- case ans of STret s' x -> (# s', x #)
-
{-# NOINLINE unsafeInterleaveST #-}
unsafeInterleaveST :: ST s a -> ST s a
unsafeInterleaveST (ST m) = ST ( \ s ->