Skip to content

Instantly share code, notes, and snippets.

@realeroberto
Created February 6, 2016 14:57
Show Gist options
  • Save realeroberto/38f9ada5628af0b28dec to your computer and use it in GitHub Desktop.
Save realeroberto/38f9ada5628af0b28dec to your computer and use it in GitHub Desktop.
My first attempt at "coding" in Standard ML.
(* factorial *)
(* my first Standard ML ``program'' *)
(* see the excellent tutorial at *)
(* http://www.soc.napier.ac.uk/course-notes/sml/manual.html *)
fun factorial(1) = 1
| factorial(n) = n * factorial(n-1);
print (Int.toString(factorial(10)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment