Thanks, Ryan, for the reminder and explanation of this problem. - Conal<br><br><div class="gmail_quote">On Mon, Apr 28, 2008 at 8:01 PM, Ryan Ingram <<a href="mailto:ryani.spam@gmail.com">ryani.spam@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The problem I have with all of these STM-based solutions to this<br>
problem is that they don't actually cache until the action fully<br>
executes successfully.<br>
<br>
For example, if you have a :: TIVal a, and f :: a -> TIVal b, and you execute<br>
force (a >>= f)<br>
<br>
and the action returned by f executes retry for whatever reason, then<br>
the caching done in "a" gets undone. Ideally I want to be able to<br>
provide some proof that the result of a is pure and have it committed<br>
immediately when it finishes.<br>
<br>
Every attempt I've had so far to solve this problem ends up being some<br>
type of the form<br>
newtype X a = IO (STM (Either a (X a)))<br>
which has its own problems.<br>
<font color="#888888"><br>
-- ryan<br>
</font></blockquote></div><br>