Some statistics functions writen in Haskell