Added solution to problem 18 in haskell.