I can write lambdas id_Int and id_Boolean with explicit type. And I can write function identity with type parameter. Can I write lambdas with type parameter?
fun testFuncInt(f: (Int) -> Int): Int = f(1) + 2
val id_Int = { x: Int -> x }
fun testFuncBoolean(f: (Boolean) -> Boolean): Boolean = !f(false)
val id_Boolean = { x: Boolean -> x }
fun <T> identity(x: T) = x
fun main(args: Array<String>) {
println(testFuncInt(id_Int))
println(testFuncInt(::identity))
println(testFuncBoolean(id_Boolean))
println(testFuncBoolean(::identity))
}