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

Referential transparency

Referential transparency generally means that we can always replace a function with its return value without an effect on the application's behavior.

Referential transparency is a guarantee of code reusability. Also, it denies the mutable state of data. In the case of a mutable state, two calls of the same function can potentially produce two different results, which is very difficult to test and maintain.

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