Functors in Functional Programming


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 :