
29 Apr
2009
29 Apr
'09
6:55 p.m.
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/glasgow-haskell-bugs@haskell.org/msg03555.html