Solved 12 in Haskell