concept single function in category kotlin

appears as: single function
The Joy of Kotlin

This is an excerpt from Manning's book The Joy of Kotlin.

  • Composition and recombination of programs is much easier. To write a program, you start by writing the various base functions you’ll need and then combine these functions into higher-level ones, repeating the process until you have a single function corresponding to the program you want to build. And, because all these functions are referentially transparent, they can then be reused to build other programs without any modifications.
  • 10.10.2 Folding with a single function

    It’s also possible to fold with a single function taking an additional parameter, which means, for example, a function from B to A to B to B. Once again, there’ll be many possible implementations, depending on the traversal order.