Skip to content
Snippets Groups Projects
Commit ea192a09 authored by Andrew Martin's avatar Andrew Martin Committed by Marge Bot
Browse files

base: Add documentation that liftA2 used to not be a typeclass method

parent 2ec749b5
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment