Monad composition
John Hughes
rjmh@cs.chalmers.se
Fri, 25 Jan 2002 12:23:45 +0100 (MET)
Andre W B Furtado wrote:
>Well, it's also possible to interchange data between these two monads by:
>
>unsafeIOToST :: IO a -> ST s a
>stToIO :: ST s a -> IO a
>
>Can anyone tell the possible problems related to
>unsafeIOToST?
>^^^^^^
Probably in the same manner as with unsafePerformIO:
it can break referential transparency.
Indeed,
unsafePerformIO m = runST (unsafeIOToST m)
so they're just as unsafe as each other.
John Hughes