Skip to content

Instantly share code, notes, and snippets.

@thealmarty
Last active January 28, 2019 23:56
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 thealmarty/d83f1015787b762392046edde735d707 to your computer and use it in GitHub Desktop.
Save thealmarty/d83f1015787b762392046edde735d707 to your computer and use it in GitHub Desktop.
Factorial function in Haskell.
--Factorial function, short/standard version.
fact 0 = 1
fact n = n * fact (n - 1)
main = do
print (fact 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment