February 2018
Intermediate to advanced
350 pages
7h 35m
English
A special case of partial application is binding. With binding, you pass a T parameter to the (T) -> R function but without executing it, effectively returning an () -> R function:
fun main(args: Array<String>) { val footer:(String) -> String = {content -> "<footer>$content</footer>"} val fixFooter: () -> String = footer.bind("Functional Kotlin - 2018") //alias for partially1 println(fixFooter())}
The function bind is just an alias for partially1, but it makes sense to have a separate name for it and make it more semantically correct.
Read now
Unlock full access