STM check operation

Simon Peyton-Jones simonpj at
Fri Jul 14 08:22:22 EDT 2006

| Thanks for your reply.  I'm a bit confused, however.  There is a
| function
| "check :: Bool -> STM a" in the STM library, but it appears to act
| differently than the one described in the paper.  This version of
| seems to cause a transaction to block when its (check's)  first
| is False, rather than issue an error or exception.  Is this right?]

True, alas.  In 6.4.2, 'check' is defined thus:	

check :: Bool -> STM a
check b = if b then return undefined else retry

But in 6.6 that's changing to the new semantics described in the
invariants paper.  Sorry.


More information about the Glasgow-haskell-users mailing list