In my experience, applicative functors are great for the following reasons:
Some types of data structures allow powerful composition types, but monads cannot actually be made. In fact, most abstractions in functional reactive programming fall into this category. Although we may technically be able to make, for example, a Behavior (aka Signal ) monad, it usually cannot be performed efficiently. Applicative functions allow us to still have powerful compositions without sacrificing efficiency (admittedly, itโs a little more difficult to use applicative than a monad, sometimes because you donโt have much structure to work with).
The absence of data dependence in the applicative functor allows you, for example, go to the action, looking for all the effects that it can produce without data. Thus, you can imagine the application of the "web form" used as follows:
userData = User <$> field "Name" <*> field "Address"
and you can write an engine that will move to find all the fields used and display them in the form, and then when you run the data again, run the built User . This cannot be done with a simple functor (because it combines two forms into one) and monads, because with a monad you can express:
userData = do name <- field "Name" address <- field $ name ++ " address" return (User name address)
which cannot be displayed, because the name of the second field cannot be known without already responding from the first. I am pretty sure that there is a library that implements the idea of โโthis form. I rolled back this and this project several times.
Another nice thing about applicative functors is that they compose. More precisely, a composition functor:
newtype Compose fgx = Compose (f (gx))
applies when f and g . The same cannot be said for monads, which created the entire history of the transformation of the monad, which is complicated by some unpleasant ways. Applicable methods are super-clean in this way, and this means that you can create the structure of the required type by focusing on the small constituents.
Recently, the ApplicativeDo extension has appeared in the GHC, which allows you to use do notation with applications, easing some of the notation complexity if you don't do any monotonous things.