[Haskell-cafe] Re: Caching the Result of a Transaction?

Conal Elliott 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
> execute
>   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...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080428/e8337216/attachment.htm


More information about the Haskell-Cafe mailing list