Skip to content

Instantly share code, notes, and snippets.

@JohnMGant
Created October 2, 2020 18:41
Show Gist options
  • Select an option

  • Save JohnMGant/63666c85ad3500df19346c736964755b to your computer and use it in GitHub Desktop.

Select an option

Save JohnMGant/63666c85ad3500df19346c736964755b to your computer and use it in GitHub Desktop.
Adding an array of integers in F#
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