Created
July 4, 2012 17:39
-
-
Save davidgrenier/3048537 to your computer and use it in GitHub Desktop.
seqYield vs functions
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
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