[Haskell-beginners] making function problem (chapter 6 of Programming in Haskell)