Haskell refs backed by an IntMap for persistence and reversibility