The tutorial claims that both MVars and IORefs are thread-safe, but IORefs are only thread-safe in very limited circumstances which require careful use of atomicModifyIORef and not more than one IORef. I'd recommend removing the bit about IORefs completely, as real applications with handlers accessing refs will almost always be better off with an MVar.