Basic iterables.

Static methods

@:value({ step : 1, start : 0 })staticcount(start:Int = 0, step:Int = 1):Iterable<Int>

Creates an iterable, that counts indefinitely.

Parameters:

start

The number to start counting from.

step

The amount to step by.

Returns:

An iterable that first yields start, then is offset by step each time.

staticempty<T>():Iterable<T>

Creates an iterable, that yields no elements.

Returns:

An iterable, that has no elements.

staticone<T>(element:T):Iterable<T>

Creates an iterable, that contains a single element.

Parameters:

element

The element to return from the iterable.

Returns:

An iterable, that yields element once.

staticrepeat<T>(element:T):Iterable<T>

Creates an iterable, that repeats an element indefinitely.

Parameters:

element

The element to repeat.

Returns:

An iterable, that repeats element forever.