X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek2_lambda_intro.mdwn;h=d002abf8da0287a592c2286749f95f22a2326ab6;hp=3718d317134eab8993ec3684dc644e4bae948ca4;hb=4ab26de71d9694f5a65a80cd87d11734cc6aa02b;hpb=a9aa00567a448746beece0fd605b29fadb64686c diff --git a/topics/week2_lambda_intro.mdwn b/topics/week2_lambda_intro.mdwn index 3718d317..d002abf8 100644 --- a/topics/week2_lambda_intro.mdwn +++ b/topics/week2_lambda_intro.mdwn @@ -228,7 +228,12 @@ abbreviates: ((\x (\y (x y))) x) -We didn't have to insert any parentheses around the inner body of `\y. (x y)` because they were already there. +The outermost parentheses were added because we have an application. `(\x. \y. +...)` became `(\x (\y. ...))` because of the rule for dots. We didn't have to +insert any parentheses around the inner body of `\y. (x y)` because they were +already there. That is, in expressions of the form `\y. (...)`, the dot abbreviates +nothing. It's harmless to write such a dot, though, and it can be conceptually +helpful especially in light of the next convention... **Merging lambdas** An expression of the form `(\x (\y M))`, or equivalently, `(\x. \y. M)`, can be abbreviated as: @@ -270,7 +275,7 @@ For some lambda terms, it is easy to see what function they represent: simply returns `M`: `((\x x) M) ~~> M`. > `(\x (x x))` duplicates its argument (applies it to itself): -`((\x (x x)) M) ~~> (M M)` +`((\x (x x)) M) ~~> (M M)` > `(\x (\y (y x)))` reorders its two arguments: `(((\x (\y (y x))) M) N) ~~> (N M)`