Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In haskell you can write exactly the following:

    fact 0 = 0
    fact 1 = 1
    fact n = n * fact (n-1)
It works as you would expect and really they aren't that dissimilar.


Small correction, fact 0 = 1




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: