Haskell solutions.
Please mention on my talk page corrections and improvements you've made to code I've submitted along with reasoning. Thanks!