3 ms·
That can be nice in a lot of situations. e.g. (+) 4 2 vs. (+) <$> Just 4 <*> Just 2 I usually prefer the applicative style above to liftA2 (+)
by greydius 11y ago
That can be nice in a lot of situations. e.g.
(+) 4 2
vs.
(+) <$> Just 4 <*> Just 2
I usually prefer the applicative style above to
liftA2 (+) (Just 4) (Just 2)
because it preserves the "form" of the original expression and generalizes to more arguments. ie. it doesn't require liftAn for whatever n number of arguments my function takes.