Applicative Functors
An Applicative Functor is a Functor equipped with a function that takes a value to an instance of a Functor containing that value. Applicative Functors provide us with the ability to operate on not just values, but values in a functorial context, such as optionals, without needing to unwrap or map over their contents.
Let's suppose that we have an optional Functor (an optional that has the map function), and suppose we cannot directly apply the map function on optionals as we need to unwrap them first. Applicative Functors come to the rescue. They add a new function, for instance, apply to the Functor to make it possible to apply map on the Functor.
In other words, Applicative Functors enable us to put a function inside ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access