function

monads

Back2Basics: Understanding Partial Functions – #1

Reading Time: 3 minutes   In this blog, we will talk about partial functions. We know about functions in Scala. Let’s talk about it first. So, what is a function? A function is a mapping or a transformation of an input to an output. For example,  we have function isEven, which takes an int value and retuns boolean value. scala> def isEven(x :Int) = x % 2 == 0 Continue Reading

Back2Basics: Demystifying Eta Expansion

Reading Time: 4 minutes In this blog, we will talk about eta expansion in Scala. How they behave under the hood before and after Scala version 2.12. Scala has both methods and functions in Scala. We refer them interchangeably but there are situations where the difference matters. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file Continue Reading

Back2Basics: Do you know Scala Eta-Expansion and HOF Chemistry?

Reading Time: 2 minutes I am working on Scala from last 2 years, and pretty confident about Scala concept like HOF, Currying and more. But Recently again looking into the HOF (Higher Order Functions) in Scala. I am pretty confident, HOF is “Passed a function as an argument”, “Assign functions to variables” and “Return functions from function” and the conclusion is Functions are First Class Citizen. For me, these Continue Reading