Search Results for: funhop

FunHop: Working with Exceptions in Scala – Problem Statement

Reading Time: 2 minutes If you look at the earlier posts in the FunHop series, you would notice that Exceptions are side effects. Exceptions by their very nature also break referential transparency and are context dependent. You would have got an idea about referential transparency from our earlier post. If not, it might be a good idea to review it once. Let us consider the code sequence below def Continue Reading

FunHop: Understanding Referential Transparency

Reading Time: 3 minutes In this episode of FunHop, we would try to look at what is Referential Transparency, what is substitution model and how being immutable really helps. Referential transparency means that we can exchange the expression by its value or a value by the expression and nothing changes. Pure functions are referentially transparent. Any function f(a)=b is a pure function if for the same “a” we end Continue Reading

FunHop : What Are These Side Effects?

Reading Time: 2 minutes FunHop is imagined as a series which allows us to gradually hop into the realms of Functional Programming. Our vehicle for the journey is going to be Scala but the fundamentals are applicable across languages. In this episode we would try to decipher Side Effects. We keep hearing that pure functions are the ones where there are NO side effects. Let us begin with an Continue Reading