liftA2

Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap.

Example

>>> liftA2 (,) (Just 3) (Just 5)
Just (3,5)
>>> liftA2 (+) [1, 2, 3] [4, 5, 6]
[5,6,7,6,7,8,7,8,9]
Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap.

Example

>>> liftA2 (,) (Just 3) (Just 5)
Just (3,5)
Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap. Using ApplicativeDo: 'liftA2 f as bs' can be understood as the do expression
do a <- as
b <- bs
pure (f a b)
Like liftA2, but for sorted lists, requiring an Ord instance. The behavior is same as with lists, but with sorted results.
Equivalent of liftA2 for rank 2 data types
Lifted liftA2. Lifts backpropagatable functions to be backpropagatable functions on Traversable Applicatives.
liftA2, but taking explicit add and zero.
liftA2, but with Num constraints instead of Backprop constraints.
Specialization of hliftA2.
Specialization of hliftA2.
Specialization of hliftA2.
Specialization of hliftA2.
Like liftA2, but traverses over its first argument
Like liftA2, but traverses over its second argument
Like liftA2, but traverses over both its arguments
Append an action to the left of an Aps.