Functors
Learn how to use the Just, Nothing, and List functors.
We'll cover the following...
What are functors?
We need to be a little careful, as the term functor has different meanings in different branches of computing. For example, it is sometimes used simply to refer to a function object. That is not what we mean here.
If you are familiar with the Haskell programming language,
oslash
functors are based closely on those.
A functor is an object that wraps a value and provides a map
method that can be used to apply a function to that value.
Most of the functors we discuss in this section are also ...