Solve problems 8,12-13 using Haskell.