A safe approach to CAS and other atomic ops in Haskell
https://github.com/rrnewton/haskell-lockfree/wiki