06 Recursive functions

You must explicitly state that a function is recursive:

let rec fun ...

This is an implementation of the factorial function recursively in OCaml:

The reason that we need to write fact (n - 1) rather than fact n - 1 is because otherwise OCaml will parse the argument as n, rather than n - 1

What happens if we don't use the rec keyword? OCaml will throw an error.

We can fix this by adding the rec keyword.