Function Categories

There are three broad categories of functions that compose a functional program: transforms, filters, and combines. Each category is designed to work on collection data structures to yield a final result. Functions in functional programming are also designed to be composable, meaning that simple functions can be combined to build complex behavior.

Transforms

The first category of function in functional programming is transforms. A transform function works on the contents of a collection by walking through the collection and transforming each item with a transformer function provided as an argument. The transform function then returns a copy of the modified collection, and execution proceeds to the next ...

Get Kotlin Programming: The Big Nerd Ranch Guide, First Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.