homework 6 and solutions for the haskell programming language 7146244