Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created November 26, 2012 22:26
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 adilakhter/4151069 to your computer and use it in GitHub Desktop.
Save adilakhter/4151069 to your computer and use it in GitHub Desktop.
list.average
let avg list =
let rec avgAux sum length list =
match list with
| [] -> sum/length
| x::xs -> avgAux (x+sum) (length + 1) xs
avgAux 0 0 list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment