hi,
here is a patch that adds a lazy runST to the glaExts/LazyST.lhs module
---------------------------------------------------------------
*** LazyST.lhs.orig Mon Dec 1 09:53:08 1997
--- LazyST.lhs Wed Dec 3 02:50:42 1997
***************
*** 10,29 ****
\begin{code}
module LazyST (
! ST,
! unsafeInterleaveST,
-- ST is one, so you'll likely need some Monad bits
module Monad,
! ST.STRef,
! newSTRef, readSTRef, writeSTRef,
! ST.STArray,
! newSTArray, readSTArray, writeSTArray, Ix,
! strictToLazyST, lazyToStrictST
) where
import qualified ST
--- 10,32 ----
\begin{code}
module LazyST (
! ST,
! unsafeInterleaveST,
-- ST is one, so you'll likely need some Monad bits
module Monad,
+ runST,
! ST.STRef,
! newSTRef, readSTRef, writeSTRef,
! STArray,
! newSTArray, readSTArray, writeSTArray, boundsSTArray,
! thawSTArray, freezeSTArray, unsafeFreezeSTArray,
! Ix,
! strictToLazyST, lazyToStrictST
) where
import qualified ST
***************
*** 33,39 ****
--- 36,45 ----
import PrelBase ( Eq(..), Int, Bool, ($), ()(..) )
import Monad
import Ix
+ import GHC
+ runST (ST f) = let (x,_) = f (STBase.S# realWorld#) in x
+
newtype ST s a = ST (STBase.State s -> (a,STBase.State s))
instance Monad (ST s) where