Scala Monads

explore either in cats library

Exploring Eval Monad in Cats

Reading Time: 4 minutes While exploring Cats I learned about Monads and its different instances available for use and now I’m here sharing all of that with you all. 😊 In today’s blog, we will be exploring Eval Monad in Cats. Model of Evaluation From the model of evaluation, I am referring to the way that the value will be evaluated. Generally, we have two of them i.e. Eager 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

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: map vs flatMap

Reading Time: 3 minutes While working with collections in Scala we frequently find ourselves using two most popular Functional combinators i.e, map() and its close cousin flatMap(). Both are higher-order functions. Click here to know more about higher order functions. In this blog, we will explore the the map and flatMap in detail. map(): The map method transforms a collection by applying a function to each element of that collection. map is a function Continue Reading

Monads: Are they really that complicated?

Reading Time: 5 minutes I have been working on Scala for around 2.5 years now, but still, feel that I have yet to explore a lot in this language. There are still a lot of topics unexplored. One such topic is Monads. I have heard and read about it a lot of times but never actually got a chance to explore it. Recently I came across the term and Continue Reading

Simplifying Monads in Scala

Reading Time: 2 minutes Monads are not at all a complex topic, but yes it comes under the advanced section of Scala language. So basically Monads is a structure that represents sequential computations. Monads is a structure that represents sequential computations, Monad is not a class or a trait; monad is a concept. A monad is an object that wraps another object in Scala, In Monad the output of a Continue Reading