Skip to content

Instantly share code, notes, and snippets.

@Polyrhythm
Created October 3, 2012 05:14
Show Gist options
  • Save Polyrhythm/3825149 to your computer and use it in GitHub Desktop.
Save Polyrhythm/3825149 to your computer and use it in GitHub Desktop.
Factorial function with tail call
let rec factorial acc n = match n with
| 0 -> acc
| n -> factorial (n * acc) (n-1)
let factorial_res = factorial 1 6
@hhugo
Copy link

hhugo commented Oct 3, 2012

great tutotrial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment