[Haskell-beginners] Simplifying code