<div dir="ltr">Thanks again!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 22, 2020 at 11:59 AM Francesco Ariis <<a href="mailto:fa-ml@ariis.it">fa-ml@ariis.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Il 22 dicembre 2020 alle 11:48 Lawrence Bottorff ha scritto:<br>
> flipA :: (a -> b -> c) -> b -> a -> c<br>
> flipA f x y = f y x<br>
> <br>
> What is it specifically about currying that makes flipA possible?<br>
<br>
I do not see how currying is involved here! Maybe when you pass<br>
a function to an higher order one?<br>
<br>
> flipB :: (a -> b -> c) -> b -> a -> c<br>
> flipB f = \x y -> f y x<br>
> <br>
> Also, with flipB, could someone explain the beta reduction? It looks<br>
> like f is not being acted on, just passed along, Would it look more<br>
> like this in lambda calculus?<br>
<br>
Indeed `f` is not being acted on (i.e. it is «outside» of the lambda)<br>
<br>
    (λx. λy. f y x) b a<br>
    (λy. f y b) a          beta<br>
    f a b                  beta<br>
<br>
fully expressed with lambdas would be:<br>
<br>
    (λf. λx. λy. f y x) g b a<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div>