Created
May 8, 2015 23:17
-
-
Save jmdeldin/8029ce7b65764bff72e3 to your computer and use it in GitHub Desktop.
List summation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sum lst = | |
let rec aux acc rest = match rest with | |
| [] -> acc | |
| x::xs -> aux (x+acc) xs in | |
aux 0 lst;; | |
sum [3;1;4;1;5;9];; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment