Recursive Functions Using Patterns
fun fact 0 = 1 |
fact n = n * fact(n-1);
val fact = fn : int -> int
fact 5;
val it = 120
Previous slide
Next slide
Back to first slide
View graphic version