Skip to content

Instantly share code, notes, and snippets.

@yutopp
Created January 30, 2015 16:15
Show Gist options
  • Save yutopp/731c1431c3d46ec9842d to your computer and use it in GitHub Desktop.
Save yutopp/731c1431c3d46ec9842d to your computer and use it in GitHub Desktop.
let double n = n *. 2.0 ;;
print_newline() ;;
let rec f n = if n == 0 then () else f (n - 1); print_int n; print_newline();;
f 10;;
print_float (double 3.14);;
print_newline();;
let rec sum n = if n == 0 then 0 else n + sum (n-1);;
print_int (sum 10);;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment