Created
February 25, 2018 05:32
-
-
Save viebel/e6c989ff2274a35a89547c02491f4e0f to your computer and use it in GitHub Desktop.
This file contains 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 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