Last active
November 10, 2015 19:02
-
-
Save Eckankar/77527285cafa5aff12ab to your computer and use it in GitHub Desktop.
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
local | |
fun avgSum' sum n [] = ([], sum div n) | |
| avgSum' sum n (x::xs) = | |
let val (rs, avg) = avgSum' (sum+x) (n+1) xs | |
in ((x-avg) :: rs, avg) end | |
in | |
val avgSum = #1 o avgSum' 0 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment