1. Binary Search

Binary search is an efficient algorithm for finding an element from a sorted list of elements. It is a searching algorithm based on the design paradigm of divide and conquer. It gives us a pretty decent run time of O(log n) as compared to the O(n) of linear search in worst-case scenarios. In this algorithm, we recursively divide our array in half until we find the element we are searching for or the list narrows down to one element which does not match our element.

2. Need of Binary Search

We use binary search in some or other form in our daily life. For example…

Image from here

1. Variance

Variance is the interconnection of subtyping relationship between complex types and their component types.

Variance is all about sub-typing. It tells us if a type constructor is a subtype of another type constructor. Variance defines inheritance relationships of parameterized types(types that have parameters within them).


Every programming language supports the concept of types. Types give information about how to handle values at runtime. Subtyping adds more constraints to the values of a type.

Let’s see an example of subtyping:

sealed trait Polygon
case object Parallelogram extends Polygon
case object Rectangle extends Parallelogram
case object Square extends Rectangle

The type Square

This is the logo for JavaFX.

1. Overview

JavaFX is a Java library used to build Rich Internet Applications (RIA). It provides a set of graphics and media packages that enables developers to design, create, test, debug, and deploy rich client applications that operate consistently across diverse platforms.

JavaFX provides a rich graphical user interface. JavaFX has the structure and APIs specifically for animation, 2D and 3D geometry, charts, special effects, color gradients, graphical controls, and easy manipulation of media, including audio, video, and images.

2. JavaFX Key Features

  • Cross-platform compatibility: JavaFX is available on the leading desktop operating systems (Windows, Linux, and Mac OS X).
  • Java library: JavaFX is a Java…

Scala with Cats

1. Overview

In this tutorial, we’ll take a look at Functor type class in Cats. The idea of Functor is “something that can be mapped over”, we’ll see what is actually mapped and how. In functional programming, Functors come into play when we have types or values wrapped inside contexts or containers. We don’t have to know any of the implementation details of those contexts or containers themselves.

2. SBT Dependencies

To start, let’s add the Cats library to our dependencies :

libraryDependencies += "org.typelevel" %% "cats-core" % "2.2.0"

Here we’re using version 2.2.0 of the Cats library.

3. What is a Functor?

In terms of functional programming, a Functor…


Git Flow is an abstract idea of a Git workflow. It helps with continuous software development and implementing DevOps practices. The Git Flow Workflow defines a strict branching model designed around the project release. This provides a robust framework for managing larger projects.

Git Flow is ideally suited for projects that have a scheduled release cycle and for the DevOps best practice of continuous delivery. It assigns very specific roles to different branches and defines how and when they should interact. It uses individual branches for preparing, maintaining, and recording releases.

Working of Git Flow

1. Develop and Master Branches

Instead of a single master branch, Git Flow uses…

In my previous article Dev Tools to the Rescue — Part 1, we looked at some of the best developer tools for software development, project management, continuous delivery/integrity, designing, testing, etc.

In this article, we’ll continue with tools that are helpful for purposes like monitoring, analysis, cloud development, security, etc.


Confluence is a team collaboration application that allows teams to work together and share information and updates effectively. It may be seen as a wiki or knowledge base that organizes and stores all of the different projects’ information assets.


  • Provides real-time editing and publishing updates that highlight the changes, tracked…

Whether you are a software developer working on someone else’s projects or you run a business yourself, utilizing the right tools of the trade is essential.

The market of software development tools is an ever-changing one and increasingly competitive. It’s a tough task to decide which one is best suited for you.

In this article, we will review some of the best developer tools, ranging from software development and project management to continuous delivery/integrity, designing, testing, etc.


GitHub is a code version control system and a project management system. It is a social network platform for developers.


  • Provides a platform…

Photo by Kate Stone Matheson on Unsplash

If you’re new to the concept of type classes I suggest you read my other article explaining them. The Cats library makes extensive use of type classes and a basic understanding is a prerequisite for this article.

In previous articles, we talked about Semigroups and Monoids, which are abstractions that let us combine values of the same type together.

In this post, we’ll take a look at Functors, which allow us to operate on values inside containers without having to know any of the implementation details of the containers themselves.

What are Functors?

In terms of functional programming, a Functor is simply something…

Photo by Chris Barbalis on Unsplash

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, and another one is the empty method that performs identity operation.

In the post about Semigroups, we saw an example where we’re using Semigroups along with Scala’s fold() to operate on a collection…

Photo by Clément Falize on Unsplash

New to Cats? No worries, go through my previous article Getting Started with Scala Cats to understand how amazing Cats is.

In this article, we will cover the concepts and implementation of Semigroups in Cats.

What are Semigroups?

In functional programming terms a Semigroup is a concept which encapsulates aggregation with an associative binary operation.

The Semigroup type class comes with a method combine which simply combines two values of same data type by following the principle of Associativity.

combine method is constructed as:

trait Semigroup[A] {
def combine(x: A, y: A): A

and can be implemented as:

// The type class…

Mansi Babbar

Software Developer | Tech Blogger | Scala | Java | Akka | Reactive Microservices

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store