Lambda expressions

import kotlin.math.pow

//explicitly specify return type 
val powOfTwo = {
    power: Int -> 2.0.pow(power)
}
val pow8 = powOfTwo(8)
//pow8 is 256.0

//implicitly specified return type
val powOfThree: (Double) -> Double = {
    power -> 3.0.pow(power)
}
val pow3 = powOfThree(3.0)
//pow3 is 27.0

println("pow8 is $pow8")
println("pow3 is $pow3")