class A(val b1: () -> Unit) { infix fun foo(b2: () -> Unit) { b1() b2() } } fun forC(b1: () -> Unit) = A(b1) //Usage: forC {} foo {}