Haskell-beginners problem with memory consuption