[Haskell-cafe] STM and FFI
arnarbi at gmail.com
Tue Sep 9 05:55:56 EDT 2008
On Tue, Sep 9, 2008 at 11:36, Jules Bean <jules at jellybean.co.uk> wrote:
> ...not only must it be safe to be called with invalid inputs, but it most
> not have any long-term effects, whether the input is valid or invalid, since
> I do not believe that there is any way for the function to 'undo' its effect
> at 'retry' time.
Maybe this is an idea for an extension to the STM system, adding
something like unsafeIOToSTM, except that in addition to the main IO
action, it also takes two more IO actions that are invoked on rollback
and commit, respectively.
This might allow for integration with transactional systems (e.g. a
remote transaction on an rdbms), although to support two-phased commit
we'd need a third action for the "prepare" step.
More information about the Haskell-Cafe