Consider deprecating STM invariant mechanism
fryguybob and I were recently discussing the STM invariant mechanism (e.g. Control.Monad.STM.check
). This mechanism is, presumably, intended to expose problems from odd interleavings of transactions. However, fryguybob pointed out that the implementation currently takes so many locks that it very likely prevents these odd interleavings from occurring.
In addition,
- the implementation doesn't handle nested STM invariants correctly (#7930 (closed))
- the locking behavior of the implementation was, until very recently, utterly wrong (#14310 (closed))
- the feature introduces quite a bit of complexity in the RTS
- the interface has essentially no users, as evidenced by a Hackage search and the fact that #14310 (closed) went unnoticed for years
All of this raises the question: Is the STM invariants feature really where we want to spend our complexity budget? Perhaps it is time for this feature to quietly pass (after an appropriate deprecation period, of course).