Companion

Functions

Link copied to clipboard

Builds a KoneSequence using the provided coroutine-based builder function.

Link copied to clipboard
Link copied to clipboard

Creates an infinite KoneSequence filled with the specified element.

Creates a finite KoneSequence of the given size filled with the specified element.

Link copied to clipboard

Creates an infinite KoneSequence by invoking the initializer function for each index (i.e. for each natural number from 0 to positive infinity).

fun <Element> KoneSequence.Companion.generate(size: UInt, initializer: (index: UInt) -> Element): KoneSequence<Element>

Creates a finite KoneSequence of the given size by invoking the initializer function for each index on each element access.

fun <Element> KoneSequence.Companion.generate(indices: UIntRange, initializer: (index: UInt) -> Element): KoneSequence<Element>

Creates a KoneSequence for the given indices range by invoking the initializer function for each index on each element access.

Link copied to clipboard
fun <Element> KoneSequence.Companion.induce(initialElement: Element, inducer: (index: UInt, previous: Element) -> Element): KoneSequence<Element>

Creates an infinite KoneSequence by induction: starting from initialElement, each subsequent element is produced by applying inducer to the previous element.

fun <Element> KoneSequence.Companion.induce(size: UInt, initialElement: Element, inducer: (index: UInt, previous: Element) -> Element): KoneSequence<Element>

Creates a finite KoneSequence by induction: starting from initialElement, each subsequent element is produced by applying inducer to the previous element.

fun <Element> KoneSequence.Companion.induce(indices: UIntRange, initialElement: Element, inducer: (index: UInt, previous: Element) -> Element): KoneSequence<Element>

Creates a KoneSequence by induction over the given indices range: starting from initialElement, each subsequent element is produced by applying inducer to the previous element.

Link copied to clipboard

Creates a KoneSequence from the given vararg elements.