
23 Apr
2008
23 Apr
'08
3:12 p.m.
On 4/23/08, Jan-Willem Maessen
I've been trying to decide whether either of these is implementable in terms of `orElse`, in such a way that we immediately check the predicate upon retry before doing anything else. I can't quite make up my mind whether this is possible or not.
I do not think it is possible; consider this case: broken = atomically $ do v <- expensive_computation :: STM (TVar Int) retryUntil v (> 50) Given that you don't know which tvar to use until the end of the expensive computation, I don't see how you can lift "orElse" to the make that tvar be the first thing checked when the transaction is rerun.