Homework for the Haskell course: http://www.seas.upenn.edu/~cis194/spring13/lectures.html