O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

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

First-class values

In an FP language, functions/methods should be first-class citizens.

First-class-citizen functions will enable us to use most FP paradigms if they satisfy the following rules:

  • Functions/methods should be usable as function/method parameters and arguments
  • Functions/methods can be returned as a result of a function/method
  • Functions can take place in data structures

So far, we have seen an example implementation of all these rules.

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