concept Applicative in category haskell

This is an excerpt from Manning's book Haskell in Depth.
Applicativeenables injecting value into a context and applying a function in a context to a value in a context.
The
Alternativetype class extents theApplicativetype class. There is also theMonadPlustype class with the same idea forMonad.
newtype MyApp logEntry state a = MyApp { runApp :: ReaderT AppEnv (WriterT [logEntry] (StateT state IO)) a } deriving (Functor, Applicative, Monad, MonadIO, MonadReader AppEnv, MonadWriter [logEntry], MonadState state)

This is an excerpt from Manning's book Get Programming with Haskell.
Figure 14.2 shows the type classes that are defined in Haskell’s standard library. Arrows from one class to another indicate a superclass relationship. This unit has covered most of the basic type classes. In unit 3, you’ll start exploring the more abstract type classes Semigroup and Monoid, and you’ll start to see how different type classes can be from interfaces. In unit 5, you’ll look at a family of type classes—Functor, Applicative, and Monad—that provide a way to model the context of a computation. Although this last group is particularly challenging to learn, it also allows for some of Haskell’s most powerful abstractions.
You’ve just finished learning about two important type classes, Functor and Applicative. Each has allowed you to perform increasingly powerful computations within a context such as Maybe or IO. Functor allows you to change individual values in a context:
GHCi> (+ 2) <$> Just 3 Just 5Applicative increases your power by enabling you to use partial application in a context. This, in turn, allows you to use multiple arguments in a context:
Applicative and Functor have taught you to think more abstractly about solving problems in types such as Maybe. The general form of the combining function you want is as follows:
Applicative f => f a -> (a -> f b) -> f bYou’ll assume the Applicative constraint rather than Functor only because Applicative is more powerful. If you can’t solve your problem with Applicative, you can’t solve it with Functor either. Now let’s take a look at the tools you get from Applicative and Functor:
(<$>) :: Functor f => (a -> b) -> f a -> f b (<*>) :: Applicative f => f (a -> b) -> f a -> f b pure :: Applicative f => a -> f aUnfortunately, for all the power you’ve gained with Applicative, it doesn’t look like any combination of these tools will solve this rather straightforward problem of wanting to chain together two functions. You can solve this problem by writing a wrapper for lookup-Credits to be a function of Maybe UserName -> Maybe PlayerCredits.
Remembering back to our visual representation of Functor, Applicative, and Monad, you’ve solved three of the four possible mismatches. The Functor’s fmap provides an adapter when you have a value in a context and a regular function, and want your result in a context, as shown in figure 30.1.
Applicative’s <*> allows you to connect a function in a context with values in a context, as shown in figure 30.2.
And finally, Applicative’s pure method allows you to handle the case of your final result not being in a context, as shown in figure 30.3.