
7 Mar
2007
7 Mar
'07
8:34 p.m.
On Thu, Mar 08, 2007 at 12:25:15PM +1100, Thomas Conway wrote:
Hi All,
Consider the following:
foo = do v <- newTVar "hi there!" throwDyn v
main = do catchDyn (atomically foo) \v -> do x <- atomically (readTVar v) putStr x
I.e. throw information that gets rolled back from inside a transaction, catch it and use it.
This looks like bad. I assume it actually works, but should it?
Read the paper! it is quite explicitly documented that exceptions can take data out of a failing transaction, spj thought it preferable to simply erasing all error data. Stefan