that didn't quite work --- it gave a type error.  

but this did

import LazyST
import ST(runST)

     .......  runST( lazyToStrictST $ ........
                   )


byron

On 1 Dec 1997, Simon Marlow wrote:

> Byron Cook <[EMAIL PROTECTED]> writes:
> 
> > in ghc-2.09 (solaris) i cannot use runST with LazyST
> > observe:
> 
> > $ cat lazy.hs
> > import LazyST
> > main = print $ f True
> > 
> > f x = runST(
> >   do n <- newSTRef x
> >      readSTRef n
> >   )
> 
> Yes: GHC's LazyST doesn't define runST at the moment (I should have
> documented this deficiency, sorry about that).  For now, you can do it
> like this:
> 
>       import LazyST
>       import ST (runST)
>       main = print $ f True
> 
>       f x = runST (lazyToStrictST (
>         do n <- newSTRef x
>            readSTRef n
>         ))
> 
> I make no claims about the LazyST stuff: it hasn't been thoroughly
> tested by any means.
> 
> Cheers,
>       Simon
> 
> -- 
> Simon Marlow                                           [EMAIL PROTECTED]
> University of Glasgow                     http://www.dcs.gla.ac.uk/~simonm/
> finger for PGP public key
> 

Reply via email to