monoids

Scala Cats - Functors

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

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

Back2Basics: Catalogue #1

Reading Time: 2 minutes Knoldus Inc is proud to announce the launch of program “Back2Basics”. Back2Basics is our effort to add value to the Scala ecosystem by exploring not so explored concepts in Scala. The idea behind the inception of the program is to develop an understanding of Scala concepts that are hard to understand and not frequently used by developers. In this program, we have two parallel tracks 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