Seq.init<'T> Function (F#)
Generates a new sequence which, when iterated, will return successive elements by calling the given function, up to the given count.
Namespace/Module Path: Microsoft.FSharp.Collections.Seq
Assembly: FSharp.Core (in FSharp.Core.dll)
The result sequence.
Each element is saved after its initialization. The function is passed the index of the item being generated.
This function is named Initialize in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.
The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
The following example demonstrates the use of Seq.init to create a sequence of the first five multiples of 10.
Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2
F# Core Library Versions
Supported in: 2.0, 4.0, Portable