Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add convert extension functions for Sequence #84

@anatawa12

Description

@anatawa12

please add functions shown below:

/**
 * Returns an immutable list containing all elements of this collection.
 */
fun <T> Sequence<T>.toImmutableList(): ImmutableList<T> = toPersistentList()

/**
 * Returns a persistent list containing all elements of this collection.
 */
fun <T> Sequence<T>.toPersistentList(): PersistentList<T> = persistentListOf<T>() + this

/**
 * Returns an immutable set of all elements of this collection.
 */
fun <T> Sequence<T>.toImmutableSet(): ImmutableSet<T> = toPersistentSet()

/**
 * Returns a persistent set of all elements of this collection.
 */
fun <T> Sequence<T>.toPersistentSet(): PersistentSet<T> = persistentSetOf<T>() + this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions