[Haskell-beginners] How would you improve this program?