Haskell homework.