Solved problem 1 in Haskell. My first Haskell solution!