
On Wed, Jan 19, 2011 at 4:44 PM, Bas van Dijk
Does newUniqueSTM give you a performance advantage in a STM transaction? Or is it just a convenience that you don't need to use unsafeIOToSTM?
It is more than a convenience, because I can't actually use unsafeIOToSTM on any IO action that internally uses atomically. Nesting 'atomically' results in the runtime system shutting down, because it has no way to backtrack and retry STM computations when they are nested. This is a consequence rather all out of proportion to the act of asking for a fresh identifier. ;) Because of the slightly simpler implementation and slightly
better performance I'm for reverting to IORefs.
Switching back to IORefs would be my preferred solution as well. -Edward Kmett