Updated Haskell code to better reflect slide examples