Created
October 2, 2020 18:41
-
-
Save JohnMGant/63666c85ad3500df19346c736964755b to your computer and use it in GitHub Desktop.
Adding an array of integers in F#
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 addInts ints = | |
| let rec loop list acc = | |
| match list with | |
| | head :: tail -> loop tail (acc + head) | |
| | [] -> acc | |
| loop ints 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment