wrote factorial in haskell