I am working on a tutorial in F # and after introducing the factorial function
let rec fact = function | 0 -> 1 | n-> n * fact(n-1);;
the authors also note that the evaluation of an expression containing fact may not be completed and add to the footnote
Note that text of type fact n is not part of F #. This is a scheme in which you can get part of the program by replacing the metacharacter n with a suitable F # object.
It went right over my head! Although I am pleased with how fact works, and with recursion in other languages, I do not see the differences that the authors are trying to make here. Any explanation is appreciated.
source share