This project is read-only.
Infinite sequence

Category:
Defining Types and Functions
Description: Infinite sequence
Code:
let InfiniteSeqSample1() = 
let evenNumbers:bigint seq =
let rec f n = seq { yield n; yield! f (n+2I) }
f 0I
printfn "infinite seq = %A" evenNumbers

Execution Result:
infinite seq = seq [0; 2; 4; 6; ...]

Last edited Sep 14, 2011 at 4:08 AM by ttliu2000, version 1

Comments

No comments yet.