On stackage.org, the following cyclic declaration exists for liftA2 and <*> for the Applicative typeclass.
(<*>) = liftA2 id
liftA2 f x y = f <$> x <*> y
Is a non-cyclic declaration available for liftA2 or <*> on the site. Are such completely cyclic references an oversight?
UPDATE:
The following (necessary) clarifying declarations seems to be missing from hoogle docs:
<*> :: Functor F => F (a -> b) -> F a -> F b
and by implication (due to cyclic declaration)
liftA2 :: Functor F => (a -> b -> c) -> F a -> F b -> F c
Is a non-cyclic definition available for liftA2?
The implementations of
(<*>)andliftA2are specific to the instances of theApplicativetypeclass. Indeed, for eachApplicativeinstance you need to implementpure, and(<*>)orliftA2, or as specified by theMINIMALpragma:For example for the
Maybeinstance ofApplicative, this is implemented as:Simply implementing
pureand(<*>)would here be sufficient, since thenliftA2is implemented in terms of(<*>). It is however often more efficient to implement the other methods as well.