This is a standard Kotlin function (as far as I know)
inline fun with(t: T, body: T.() -> Unit) { t.body() }
But could anyone write
It's called "Function literals with receiver"
Function types can optionally have an additional receiver type, which is specified before a dot in the notation: the type A.(B) -> C represents functions that can be called on a receiver object of A with a parameter of B and return a value of C. Function literals with receiver are often used along with these types.
You can found answer in kotlin offical document:Function literals with receiver