solution for some learning  problems in haskell