Function Types

Higher-order functions are an essential part of functional programming languages.

If functions can accept functions as arguments and produce functions as return values, that language is said to support higher-order functions. In previous atoms, we’ve seen higher-order functions such as filter(), map(), and any(). Kotlin functions are supported with the help of function types. If you declare a function that takes an argument of a function type, you can pass a function (including a lambda) as an argument.

End of sample. See AtomicKotlin.com for full early-access book.



Previous          Next

©2018 Mindview LLC. All Rights Reserved.