<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:small">Hi, Lawrence,</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small">Would it help you to think of addB as a function that takes its argument x and returns a function/lambda that adds x to the argument to which that returned function is applied?</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small">Best wishes,</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small">-jn-</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 23, 2020 at 9:12 PM Lawrence Bottorff <<a href="mailto:borgauf@gmail.com">borgauf@gmail.com</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"><div dir="ltr">I have these three versions of addition<div><br></div><div>addA x y = x + y<br>addB x = \y -> x + y<br>addC = \x -> \y -> x + y<br></div><div><br></div><div>and all three add two arguments just fine</div><div><br></div><div>> addA 2 3</div><div>5</div><div>> addB 2 3</div><div>5</div><div>> addC 2 3</div><div>5</div><div><br></div><div>but I can't see how addB and addC are actually accomplishing this. addA is currying, which I don't fully follow. addC I understand beta reduction-wise</div><div><br></div><div>(\x -> \y -> x + y) 2 3<br>(\y -> 2 + y) 3<br>(2 + 3)<br>5<br></div><div><br></div><div>but I don't understand addB and what steps are happening currying/beta reduction-wise. Can someone break down the steps with addA and addB?</div><div><br></div><div>LB</div><div><br></div><div><br></div></div>
_______________________________________________<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>