Skip to content

Instantly share code, notes, and snippets.

@fatih
Created October 15, 2014 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatih/57753c79e4f0ed610a0f to your computer and use it in GitHub Desktop.
Save fatih/57753c79e4f0ed610a0f to your computer and use it in GitHub Desktop.
fun main(numbers: int list) =
let
fun sum(numbers: int list) =
if null numbers
then 0
else hd numbers + sum (tl numbers)
in
sum(numbers)
end
val total = main [1,2,3,4,5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment