
Hi, Lawrence,
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?
Best wishes,
-jn-
On Wed, Dec 23, 2020 at 9:12 PM Lawrence Bottorff
I have these three versions of addition
addA x y = x + y addB x = \y -> x + y addC = \x -> \y -> x + y
and all three add two arguments just fine
addA 2 3 5 addB 2 3 5 addC 2 3 5
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
(\x -> \y -> x + y) 2 3 (\y -> 2 + y) 3 (2 + 3) 5
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?
LB
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners