Word frequency counter written in haskell