On Wed, Apr 29, 2009 at 05:26:46PM -0400, Xiao-Yong Jin wrote:
> Between the following two functions
> 
> stToIO        :: ST RealWorld a -> IO a
> stToIO (ST m) = IO m
> 
> unsafeSTToIO :: ST s a -> IO a
> unsafeSTToIO (ST m) = IO (unsafeCoerce# m)
> 
> All I can see is that the safe one uses RealWorld instead of
> an arbitrary thread s used in the unsafe one.  I really
> don't understand the difference between these two.  Why is
> the one without RealWorld unsafe?

Here's an example:

http://www.mail-archive.com/[email protected]/msg03555.html
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to