https://kotlinlang.org logo
#stdlib
Title
m

mplatvoet

12/28/2015, 8:46 AM
you won’t have to, that’s not what’s being proposed. The idea is following for instance with the
map
function:
Copy code
//lazy
fun <T, R> Sequence<T>.map(transform: (T) -> R): Sequence<R>
//lazy (for Lists etc…)
fun <T, R> Iterable<T>.map(transform: (T) -> R): Iterable<R>

//snapshot
fun <T, R> Iterable<T>.mapToList(transform: (T) -> R): List<R>