You can also do this inline using a lambda if that is the only place you are using that function
fun foo(m: String, bar: (m: String) -> Unit) {
bar(m)
}
foo("a message") {
m: String -> println("another message: $m")
}
//Outputs: another message: a message