In GHC.Base
the description of <**>
runs:
A variant of
<*>
with the arguments reversed.
It is widely known that "reversed" in that case does not mean "flipped" as:
GHCi> [1, 2, 3] <**> [(^2), (+1)]
[1,2,4,3,9,4]
GHCi> [(^2), (+1)] <*> [1, 2, 3]
[1,4,9,2,3,4]
So, what does "reversed" mean?
Side note: there are applicative functors which have (<**>) = flip (<*>)
. For example, here is my proof for the reader ((->) e
):
(->) e: f <**> g =
= liftA2 (flip ($)) f g =
= (flip ($) <$> f) <*> g =
= \e -> ((flip ($) . f) e) (g e) =
= \e -> flip ($) (f e) $ (g e) =
= \e -> (g e) $ (f e) =
= \e -> g e (f e) =
= g <*> f. => (<**>) = flip (<*>).