Higher Order Functions: Examples - devrath/KotlinAlchemy GitHub Wiki
Code
val action :() -> Unit = { println("Hello World!!")  }
fun main(args: Array<String>) {
    // Calling the action
    action()
    action.invoke()
}Output
Hello World!!
Hello World!!Code
val action :() -> Unit = { println("Hello World!!")  }
fun main(args: Array<String>) {
    // Calling the action
    consumeAction(action)
}
fun consumeAction( action :()-> Unit ){
    action()
    action.invoke()
}Output
Hello World!!
Hello World!!