
29 Apr
2009
29 Apr
'09
5:26 p.m.
Hi, 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? I tried google, but couldn't find anything helpful. -- c/* __o/* <\ * (__ */\ <