Author: Harmeet Singh(Taara)

monads

ScalaFP: Firsthand With Scala-Cats Monads – #1

Reading Time: 4 minutes In the previous post, we had a look at the reasons behind the monads and how monads can help us design the programs in a functional style. Now we are going to explore some of the monads which are frequently used in the applications but not available within the Scala predefined libraries. We will be exploring the monads which are provided by the scala-cats functional Continue Reading

monads

ScalaFP: Let’s Find The Reasons Behind Monads.

Reading Time: 5 minutes Monads in Functional Programming play an important role but they mostly confuse the beginners. One of the reasons for the confusion is that they mostly have a knowledge of imperative style programming, where they have no idea about function composition and its importance. In the terms of functional programming, the composition is the root where we have a set(Z) and we compose the elements of Continue Reading

monads

ScalaFP: Welcome To The World Of Functors

Reading Time: 4 minutes In functional programming, we have various pillars like Functors, Monads, Applicative and more. Today we will try to explore one of these pillars called Functors. First let’s explore function composition: Function Composition:  In this diagram, we have 3 sets called A, B, and C. Set A contains an element called x. Suppose, we need to convert our Set A elements into Set C. But we have no Continue Reading

ScalaFP: Mystery Of Scala Higher Kinded Type.

Reading Time: 3 minutes Scala type system holds a lot of mysteries. Sometimes these mysteries confuse us but mostly they provide us with a powerful feature. Today we will be discussing one of them called Higher Kinded Type Or Second Order Type. Before moving to higher kinded type lets brush up our basics first. Higher Order Function: So, functional programming follows an artistic rule called “functions are the first Continue Reading

ScalaFP: Understanding Monoids In Scala Pragmatically

Reading Time: 3 minutes As we discussed in our previous post, Monoids are semigroups meaning they have properties called closure and associative, along with identity element. So, now our question is, why do we require the identity element? Let’s add this one to our questions which were remaining from our previous post, : How can we use monoids with Scala? Where do we require Monoids? Now let’s answer these questions one Continue Reading

ScalaFP: Let’s Begin With Monoids

Reading Time: 2 minutes As we discussed in our semigroups post, monoids are also kind of functional design patterns. Most of the FP beginners are always confused between Monads and Monoids. According to them both are the same, Is It? In this post, we will be trying to learn “what monoids are according to mathematical terms?” For this, we just require the basic mathematical knowledge. Monoids The one line definition of Monoid Continue Reading

ScalaFP: Understanding Semigroups In Scala Pragmatically

Reading Time: 3 minutes In our previous post, we discussed semigroups according to mathematics and we conclude that semigroups have two properties called closure and associativity. But still, we have some questions like: How can we use semigroups by using Scala? Where do we require to use semigroups? First, let’s try to figure out, when and where we require semigroups in our code and during this we will automatically Continue Reading

ScalaFP: Let’s Begin With Semigroups.

Reading Time: 3 minutes While we start looking into functional programming, the first thing we find out is “Category Theory” and if you are not a mathematician, then, it is really a huge pain to find out the answers to questions like “what, how and when“. We are facing the same issue but after digging into it, we conclude that first step is to clear the concepts of “semigroups“, Continue Reading

Knolx: The Hidden Mystery Behind Scala Functional Programming

Reading Time: < 1 minute Hello everyone, Knoldus organized a session on 25th January 2018. The topic was “The Hidden Mystery Behind Scala Functional Programming”. Many people attended and enjoyed the session. In this blog post, I am going to share the slides & video of the session. Slides:

Knolx: Guaranteed No Stress Baby Steps Using Akka Streams Part-II

Reading Time: < 1 minute Hello everyone, Knoldus organized a session on 25th November 2017. The topic was “Guaranteed No Stress Baby Steps Using Akka Streams Part-II”. Many people attended and enjoyed the session. In this blog post, I am going to share the slides & video of the session. Slides:

Knolx: Guaranteed No Stress Baby Steps Using Akka Streams Part-I

Reading Time: < 1 minute Hello everyone, Knoldus organized a session on 28th October 2017. The topic was “Guaranteed No Stress Baby Steps Using Akka Streams Part-I”. Many people attended and enjoyed the session. In this blog post, I am going to share the slides & video of the session. Slides:

Back2Basics: For Expression Served From Scala Magic Box – I.

Reading Time: 3 minutes In Scala, lots of the things are kind of a magic for Java developers. Sometimes this magic amazes the code but sometimes it has ruined the developer’s life. Today we are going to discuss one of the magic called “For Expression“, “For Comprehension” or as per Java developers like me called “For Loop“. Scala developers familiar with for comprehension and most of them have the idea, Continue Reading

Back2Basics: Pass-By-Name and HOF in Scala argue as a Husband And Wife.

Reading Time: 2 minutes Scala has lots of features and one of the features always confused me called “pass-by-name” argument.  For me pass by name is same as “higher-order-function” but different from just syntax otherwise everything is same. While googling out for their difference, I found: Pass-by-name is lazy evaluation but higher-order-functions are eager. Pass-by-name is used for constructs custom controls. and maybe there are more, but these two are available everywhere. Continue Reading