[Haskell] please improve this code - thanks