scala

Explore Id Monad in Cats

Reading Time: 3 minutes Today we are going to explore Id Monad in Cats. If you don’t know about Monad I’ll suggest you go through this blog and then read this for better understanding. What is Id Monad? According to the referenced book: Id is actually a type alias that turns an atomic type into a single-parameter type constructor. Ahan! So, did you understand something? Let me explain it Continue Reading

explore either in cats library

Explore Either in Cats Library

Reading Time: 4 minutes Hey everyone, I’m back with another blog in which we are going to explore Either in Cats Library. For an introduction to Either Monad in Cats and comparison between Either in standard Scala Library and Cats Library, you can have a look at my previous blog i.e Either in Cats vs Either in Scala. Also, if you don’t know what is a Monad you can Continue Reading

Diving into Scala Cats – Monoids

Reading Time: 2 minutes Today we are going to deep dive into the Scala Cats again to find out about Monoids. If you haven’t already read my post about Diving into Scala Cats – Semigroups I suggest you do so now. What are Monoids? The Monoid extends Semigroup and adds a default or fallback value for the given type. Monoid type class comes with two methods – one is the combine method of Semigroups, Continue Reading

New Chaining Operations in Scala 2.13

Reading Time: 2 minutes Scala 2.13 gave us two chaining operations, namely pipe and tap. To call methods one after the other in one go, we use chaining operations. Pipe pipe() is used to convert the input value to a new output value formed by applying the function provided to it in the parameter.Definition : def pipe[B](f: (A) => B) : BHere, the input value of type A will be converted Continue Reading

Either in Cats vs Either in Scala

Reading Time: 4 minutes Hola amigos! Last time I discussed Monads in general and in Cats as well. In this blog, let’s have a look at one of the most known monad Either. I’ll be giving an introduction to it and also there will be a comparison between two i.e Either in Cats vs Either in Scala. What is Either? Either basically represents a value of one of two Continue Reading

Higher Order Functions and Closures in Scala

Reading Time: 2 minutes In this blog, we will go through the concepts of higher order functions and closures in Scala with the help of example. 1. Higher Order Functions A higher order function takes other functions as parameter or returns a function as a result. Let us understand it better with the help of examples: a) When a method is passed as an argument: Output: Open In the Continue Reading

Understanding Monads: An Introduction

Reading Time: 3 minutes In Scala, we all have heard about Option, Future etc. I also heard that they are Monads. It was a new term to me so I googled it and the definitions I initially read were too confusing. Here is one of them : What is Monoid? What are Endofunctors? Looking into all these is so complex. So here, I’ll try to cover Monads in a Continue Reading

Scala Beginner Series (3) : Functional Scala

Reading Time: 4 minutes This series is all about the taste of Scala.It is best suitable for all the newbies in Scala. You may also like: Scala Beginner Series (1) : BasicsScala Beginner Series (2) : Object Oriented Scala In the previous part, we covered the: Classes, constructors, inheritance, and abstract classes Traits and anonymous classes Singleton objects and companion objects Case classes and case objects This article will cover the functional Continue Reading

Combating Fallacy in Scala

Combating Fallacy in Scala: Part 3

Reading Time: 3 minutes Hey everyone, I’m back with another blog, “Combating Fallacy in Scala: Part 3“. So, in this blog, we will have a look into Classes in Scala and the Constructor Parameters. Class and Constructor Parameters Before moving to the problem in this blog, let’s have a look at classes in Scala. According to the Scala Docs “Classes in Scala are blueprints for creating objects. They can Continue Reading

Scala Beginner Series (2) : Object Oriented Scala

Reading Time: 7 minutes This series is all about the taste of Scala.It is best suitable for all the newbies in Scala. You may also like: Scala Beginner Series (1) : Basics In the previous part, we covered: Values, variables, expressions and types Functions and recursion The Unit type This article will cover the object oriented nature of Scala language. Classes Scala has the same concept of a class as we Continue Reading

Scala Beginner Series (1) : Basics

Reading Time: 4 minutes This series is all about the taste of Scala. It is best suitable for all the newbies in Scala. So here we go… This article will cover the fundamentals of Scala language. Values In Scala, we work with values: Values are used to define constants. val modifier means constant or immutable that means we cannot change its value once it is created. Thus reassignment to val is prohibited. It Continue Reading