concept referential transparency in category scala

This is an excerpt from Manning's book Functional Programming in Scala.
In this chapter, we’ll look at a simple program with side effects and demonstrate some of the benefits of FP by removing these side effects. We’ll also discuss the benefits of FP more generally and define two important concepts—referential transparency and the substitution model.
Our definition of referential transparency doesn’t take this into account. Referential transparency is with regard to some context and our definition doesn’t establish this context.
A more general definition of referential transparency

This is an excerpt from Manning's book Scala in Action.
One other interesting property of a mathematical function is referential transparency, which means that an expression can be replaced with its result. In the case of addFunction, we could replace all the calls made to it with the output value, and the behavior of the program wouldn’t change.
The value is referential transparency. Referential transparency is a property whereby an expression could be replaced by its value without affecting the program. Let’s see an example of how referential transparency works. Assume the following is a part of a functional program:
Because add is a pure function, I can replace the function call add(10, 10) with its result, which is 20, without changing the behavior of the program. And similarly I could replace add(5, 5) with 10 without affecting the behavior of the program. Why should you care about referential transparency? What advantage does it give you?
Referential transparency provides the ability to reason about your code. You can provide proof that your program works correctly by replacing pure functions with their values and reducing a complex expression to a simpler expression. Sometimes you can even compute the result of a program in your head. This ability to reason about code helps programmers to debug and solve complex problems easily. And therein lies the essence of functional programming. With varying difficulty you can do functional programming in any programming language. The essence of functional programming is referential transparency, and its benefit is referential transparency—the safety net that allows you to easily find and fix problems. When you add that to the fact that Scala is a type-safe language, you can catch lots of problem ahead of time during compilation.