[Haskell-cafe] Re: Caching the Result of a Transaction?
conal at conal.net
Tue Apr 29 00:38:03 EDT 2008
Thanks, Ryan, for the reminder and explanation of this problem. - Conal
On Mon, Apr 28, 2008 at 8:01 PM, Ryan Ingram <ryani.spam at gmail.com> wrote:
> The problem I have with all of these STM-based solutions to this
> problem is that they don't actually cache until the action fully
> executes successfully.
> For example, if you have a :: TIVal a, and f :: a -> TIVal b, and you
> force (a >>= f)
> and the action returned by f executes retry for whatever reason, then
> the caching done in "a" gets undone. Ideally I want to be able to
> provide some proof that the result of a is pure and have it committed
> immediately when it finishes.
> Every attempt I've had so far to solve this problem ends up being some
> type of the form
> newtype X a = IO (STM (Either a (X a)))
> which has its own problems.
> -- ryan
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe