Solve problems by haskell.