RE: [Haskell] optimisation of State monad