(* purpose: sum the numbers from 0 to n precondition: n must be a natural number sumTo 0 ==> 0 sumTo 3 ==> 6 *) let rec sumTo (n:int) : int = assert(n >= 0); match n with 0 -> 0 | n -> n + sumTo (n-1) ;; print_string "The sum of the numbers from 0 to 8 is: "; print_int (sumTo 8);; print_newline();;