Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add convert extension functions for Sequence #84

Closed
anatawa12 opened this issue Aug 19, 2020 · 1 comment
Closed

add convert extension functions for Sequence #84

anatawa12 opened this issue Aug 19, 2020 · 1 comment

Comments

@anatawa12
Copy link
Contributor

anatawa12 commented Aug 19, 2020

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
@qurbonzoda
Copy link
Contributor

Fixed in master.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants