Simplifying the implementation of the factorial function in haskell.