Created
May 15, 2015 08:32
-
-
Save nickleeh/e94b76724e8eb760ee62 to your computer and use it in GitHub Desktop.
Returns the first n items from a sequence in F#.
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
// Sequence of random numbers | |
open System | |
let randomSequence = | |
seq { | |
let rng = new Random() | |
while true do | |
yield rng.Next() | |
} | |
let sampleNumber = randomSequence |> Seq.take 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment