Here are my answers for the Recursion chapter of the Haskell Wikibook:
- Type the factorial function into a Haskell source file and load it into GHCi.
- Try examples like
factorial 5
andfactorial 1000
.^[3]^
- What about
factorial (-1)
? Why does this happen?
Calling factorial (-1) will never stop because …
read more