O'Reilly logo

Functional Programming: A PragPub Anthology by Michael Swaine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Use Higher-Order Functions

Another defining feature of a functional language is making functions first-class citizens. That means that not only is it possible to have functions attached to objects or structures or enums (or even inside of functions), it is also possible to have variables or constants that point to functions, to pass functions into other functions, and to return functions from functions. It is not something languages like Java can do at all. Objective-C made great strides with block syntax, and has always had use of C functions, but Swift provides even more power and much clearer syntax for dealing with functions.

The point of this power and clarity is to attack problems at a higher conceptual level. Instead of thinking about ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required