Last active
January 28, 2019 23:56
-
-
Save thealmarty/d83f1015787b762392046edde735d707 to your computer and use it in GitHub Desktop.
Factorial function in Haskell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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