June 2018
Intermediate to advanced
316 pages
6h 34m
English
A Functor is a typeclass that can be mapped. You can consider it an interface that provides the map method to map one value to another. From an object-oriented programming point of view, it's a class that implements the Mappable interface. But a Functor is something that can be applied to any type, which is why, in Kotlin, the Functor is implemented as something like a wrapper class. The following diagrams show how it works.
Here's a simple value or an object:

Let's put the object into a wrapper that represents how the map method should be applied to objects of this type:
Now you can apply different functions to this object and the ...
Read now
Unlock full access