
On Fri, May 29, 2009 at 9:34 PM, Isaac Dupree
So, how it works, as I understand it: when GHC resumes the thread, it does not re-execute the throwTo (since it was already executed last time), just like it would not re-execute a putChar. The only reason we don't use throw/throwIO is that a closure interrupted by a *synchronous* exception won't be re-tried at all by the RTS (it will memorize that it evaluates to that exception, instead -- after all, that's more efficient in normal, pure, non-unsafePerformIO cases where a thunk leads to an error-call).
now, I might have misunderstood, or it might have changed (there was a discussion a few months(?) ago, about what to do in general about throw/throwTo/unsafePerformIO; -- and this is all fiddly business)
This sounds reasonable, and would explain the behaviour of my code, but I'd still like to make sure. :-) -- Svein Ove Aas