Skip to content

Instantly share code, notes, and snippets.

@viebel
Created February 25, 2018 05:32
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 viebel/e6c989ff2274a35a89547c02491f4e0f to your computer and use it in GitHub Desktop.
Save viebel/e6c989ff2274a35a89547c02491f4e0f to your computer and use it in GitHub Desktop.
let rec sigma (f, s) =
switch (s) {
| [] => 0
| [x, ...l] => f (x) + sigma (f, l)
};
let a = sigma ((fun (x) => x * x), [1, 2, 3]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment