Translate Pascal into Haskell