[Haskell] ANN: stm-io-hooks-0.6.0

Peter Robinson thaldyron at gmail.com
Sun Dec 27 12:53:59 EST 2009


A new announcement, as the interface has changed quite a bit (e.g. 'onRetry' is
gone) and previous versions had a rare but annoying bug due to the
unpredictability of 'unsafeIOToSTM'.

>From the package description:
-----

This library provides an STM monad with commit and retry IO hooks. A
retry-action is run (at least once) if the transaction retries, while
commit-actions are executed iff the transaction commits. The AdvSTM
monad also gives some atomicity guarantees for commit-actions:

* When a TVar is modified in a transaction and this transaction
commits, the update remains invisible to other threads until the
corresponding onCommit action is run.

* If the onCommit action throws an exception, the original values of
the modified TVars are restored.

Note: This library was inspired by the AdvSTM monad on the Haskell
Wiki (see http://haskell.org/haskellwiki/?title=New_monads/MonadAdvSTM).

Feedback is welcome!

-----


More information about the Haskell mailing list