Just thinking for Applicative ((->) c)
(<*) = const
(*>) = flip const -- or \ _ x -> x

Is it because we can rely on GHC to produce the same code from the current definitions?


Also wondering why Monad uses
f >>= k = \ r -> k (f r) r

but Applicative uses
(<*>) f g x = f x (g x)
liftA2 q f g x = q (f x) (g x)

Seems like if it's style/legibility, it should be consistent between (>>=) and (<*>). And if it's inlining issue, we'd want lambdas for all three.

--Keith
--
Sent from my phone with K-9 Mail.