Destructuring in lambas


Is it possible to do something like this

val list : List<Pair<T,U>> = ... { a,b -> .... }


This will be possible in Kotlin 1.1.




I think it will rather look like this (within parentheses): { (a, b) -> /*...*/ }

Proposal is here:

I was a bit unsure, if it will make into 1.1 (before yole confirmed it will be included), because the proposal says "Status: Under consideration" and is not implemented in EAP 1.1-M01.

Also: Thanks to Java 8 support in 1.1-M01 it is now possible to use Java 8’s forEach() and use a BiConsumer:

mapOf("foo" to 1, "bar" to 2).forEach { key, value ->
    println("$key to $value")


The implementations in Kotlin 1.1 M01 are prototypes of the functionality described in the KEEPs.

Now I understand when the KEEP proposal says "Prototype: Implemented".