Skip to content

Instantly share code, notes, and snippets.

@notbend
Created May 11, 2013 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notbend/5559265 to your computer and use it in GitHub Desktop.
Save notbend/5559265 to your computer and use it in GitHub Desktop.
factorial function in haskell
factorial :: (Integral a) => a -> a
factorial 0 = 1
factorial n = n * factorial (n - 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment