Skip to content

Instantly share code, notes, and snippets.

@davidgrenier
Created July 4, 2012 17:39
Show Gist options
  • Save davidgrenier/3048537 to your computer and use it in GitHub Desktop.
Save davidgrenier/3048537 to your computer and use it in GitHub Desktop.
seqYield vs functions
seq {
for x in elements do
if x % 3 = 0 then
yield x + 12
}
// instead do:
elements
|> Seq.filter (fun x -> x % 3 = 0)
|> Seq.map (fun x -> x + 12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment