concept fun function in category kotlin

This is an excerpt from Manning's book The Joy of Kotlin.
As you’ve seen, you can write safer programs that are easier to test by composing pure functions, which mean functions without side effects. You can declare these functions using the
funkeyword or as value functions, such as the arguments of methodsgroupBy,map, orreducein the previous listing. Value functions are functions represented in such a way that, unlikefunfunctions, they can be manipulated by the program. In most cases, you can use these as arguments to other functions or as values returned by other functions. You’ll learn how this is done in the following chapters.
Why should you use them? Because
funfunctions are much more efficient. They are an optimization. Each time you use a function only to pass it an argument and get the corresponding return value, you’ll be using the version defined withfun. This is absolutely not mandatory, but it’s wise.