Created
December 23, 2019 13:31
-
-
Save vietnt/736a6f4365a5b0fff7bcd457996ca959 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 count = cval 10 | |
let set = cset { | |
let! c = count | |
for i = 1 to c do yield int64 i | |
} | |
let sum = set |> CSet.sumBy id | |
count.SetValue 10 | |
printfn "%A" sum.Value //55 | |
count.SetValue 100 | |
printfn "%A" sum.Value //5050 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment