String calculator in Haskell