Creates an infinite sequence that repeatedly applies a given function to a start value.
Namespace: SequencesAssembly: Sequences (in Sequences.dll) Version: 1.0.1.0 (1.0.1)
Syntax public static ISequence<T> Iterate<T>(
T start,
Func<T, T> func
)
public static ISequence<T> Iterate<T>(
T start,
Func<T, T> func
)
Public Shared Function Iterate(Of T) (
start As T,
func As Func(Of T, T)
) As ISequence(Of T)
Public Shared Function Iterate(Of T) (
start As T,
func As Func(Of T, T)
) As ISequence(Of T)
public:
generic<typename T>
static ISequence<T>^ Iterate(
T start,
Func<T, T>^ func
)
public:
generic<typename T>
static ISequence<T>^ Iterate(
T start,
Func<T, T>^ func
)
static member Iterate :
start : 'T *
func : Func<'T, 'T> -> ISequence<'T>
static member Iterate :
start : 'T *
func : Func<'T, 'T> -> ISequence<'T>
Parameters
- start
- Type: T
The first value of the sequence.
- func
- Type: System Func T, T
The function that's repeatedly applied to the last element to produce the next element.
Type Parameters - T
- The type of the elements in the sequence.
Return Value
Type:
ISequence T An infinite sequence obtained by repeatedly applying
func to
start.
See Also