Skip to content

Instantly share code, notes, and snippets.

@vietnt
Created December 23, 2019 13:31
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 vietnt/736a6f4365a5b0fff7bcd457996ca959 to your computer and use it in GitHub Desktop.
Save vietnt/736a6f4365a5b0fff7bcd457996ca959 to your computer and use it in GitHub Desktop.
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