Named function definitions
fun succ x = x + 1;
val succ = fn : int -> int
succ 8;
9 : int
fun fact n = if n <= 1 then 1 else n*fact (n-1);;
val fact = fn : int -> int
fact 4;
24 : int
Previous slide
Next slide
Back to first slide
View graphic version