[Haskell-beginners] How to solve this using State Monad?