summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Martin <andrew.thaddeus@gmail.com>2019-01-04 12:01:25 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-03 00:41:05 -0400
commitea192a0932c6a95d7854e86f743c11249af23ded (patch)
treebb6ac04d896fae1285e8e380ae600da039fc91e6
parent2ec749b5994aef0eff9185ad2985bfa847cec021 (diff)
downloadhaskell-ea192a0932c6a95d7854e86f743c11249af23ded.tar.gz
base: Add documentation that liftA2 used to not be a typeclass method
-rw-r--r--libraries/base/GHC/Base.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 60a485c9bd..cf9fd81c70 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -543,6 +543,9 @@ class Functor f => Applicative f where
-- 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'.
liftA2 :: (a -> b -> c) -> f a -> f b -> f c
liftA2 f x = (<*>) (fmap f x)