[Haskell-cafe] Refactoring from State monad to ST monad, for STUArray