
On Thu, Feb 14, 2008 at 10:54:37AM +0000, Duncan Coutts wrote:
This version of 'unsafePerformIO' is slightly more efficient, because it omits the check that the IO is only being performed by a single thread. Hence, when you write 'unsafeDupablePerformIO', there is a possibility that the IO action may be performed multiple times (on a multiprocessor), and you should therefore ensure that it gives the same results each time.
unsafeDupablePerformIO :: IO a -> a
TODO: Actually, unsafeDupableInterleaveIO is not yet documented, that will have to be fixed.
unsafeDupableInterleaveIO :: IO a -> IO a
I propose that unsafeDupablePerformIO be renamed to unsafePerformIO, since it satisfies all of the properties guaranteed of unsafePerformIO. GHC's unsafePerformIO guarantees more, and should be called unsafePerformIOAtMostOnce or something. Stefan