Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pipe forward operator
operator fun <T,T1> ((T) -> T1).unaryPlus(): (T.()->T1) {
val f = this
return {
f(this)
}
}
fun mkStr(t:Int) : String {
return ""
}
fun mkInt(s:String) : Int {
return 0
}
fun main(args: Array<String>) {
23.(+::mkStr)().(+::mkInt)()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.