[Haskell-beginners] Another currying and lambda question

Lawrence Bottorff borgauf at gmail.com
Tue Dec 22 17:48:02 UTC 2020


In *Learn You... <http://learnyouahaskell.com/higher-order-functions> *I'm
seeing this

flipA :: (a -> b -> c) -> b -> a -> c
flipA f x y = f y x

and this

flipB :: (a -> b -> c) -> b -> a -> c
flipB f = \x y -> f y x

What is it specifically about currying that makes flipA possible? Also,
with flipB, could someone explain the beta reduction? It looks like f is
not being acted on, just passed along, Would it look more like this in
lambda calculus?

(\x \y -> f y x)
then
(\x \y -> f y x) g a b

gives

g b a  ?

LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20201222/bef1a243/attachment.html>


More information about the Beginners mailing list