Skip to content

Instantly share code, notes, and snippets.

@nickleeh
Created May 15, 2015 08:32
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 nickleeh/e94b76724e8eb760ee62 to your computer and use it in GitHub Desktop.
Save nickleeh/e94b76724e8eb760ee62 to your computer and use it in GitHub Desktop.
Returns the first n items from a sequence in F#.
// 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