Format of a Kotlin lambda expression,

(args: types) -> <function body>

A simple lambda function

val toUpper = { text: String -> text.uppercase() }
 
fun main () {
	print ( toUpper("hello") )
}

Passing lambda function as argument to another function

fun main() {
	val names = listOf( "Abe", "B", "Caroline", "Arv")
	names.filter { name: String -> name.startsWith("A") }
}

Refs

  1. https://kotlinlang.org/docs/kotlin-tour-functions.html#lambda-expressions-practice