I play with Control.Applicative, and I understand that I don’t understand everything with a system like Haskell.
Control.Applicative
Here is my experiment at Ghci:
λ :t (<*>) (<*>) :: Applicative f => f (a -> b) -> f a -> f b λ :t (<*>) (pure 2) (<*>) (pure 2) :: (Num (a -> b), Applicative f) => f a -> f b
The type of the first argument <*>is f (a -> b).
<*>
f (a -> b)
(pure 2)
2
a -> b
Num (a -> b)
Num
<*> f (a -> b). (<*>) (pure x) , x - - .
(<*>) (pure x)
x
2 - Num a => a. , 2 , Num.
Num a => a
, (<*>) (pure 2) , 2 , Num.
(<*>) (pure 2)
, , - Num. . , , .
( , , , - Integral Fractional . . ...)
Integral
Fractional