Haskell code for the edx.org course