X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=week2.mdwn;h=6bca0c6a91538c06b0f1ad6663221f417cda6078;hb=304f65d9e05056e41a5f8ad7527cefced9b91057;hp=15995e8c3bfc378fa4559b3106bf6e14f344a257;hpb=3882862720e3f054bf53b0ddbc226da2f17eb2fb;p=lambda.git diff --git a/week2.mdwn b/week2.mdwn index 15995e8c..6bca0c6a 100644 --- a/week2.mdwn +++ b/week2.mdwn @@ -26,13 +26,15 @@ Combinators and Combinatorial Logic Lambda expressions that have no free variables are known as **combinators**. Here are some common ones: -
-**I** is defined to be `\x x`

-**K** is defined to be `\x y. x`, That is, it throws away its second argument. So `K x` is a constant function from any (further) argument to `x`. ("K" for "constant".) Compare K to our definition of **true**.

-**get-first** was our function for extracting the first element of an ordered pair: `\fst snd. fst`. Compare this to K and true as well.

-**get-second** was our function for extracting the second element of an ordered pair: `\fst snd. snd`. Compare this to our definition of false.

-**ω** is defined to be: `\x. x x`

-

+> **I** is defined to be `\x x` + +> **K** is defined to be `\x y. x`, That is, it throws away its second argument. So `K x` is a constant function from any (further) argument to `x`. ("K" for "constant".) Compare K to our definition of **true**. + +> **get-first** was our function for extracting the first element of an ordered pair: `\fst snd. fst`. Compare this to K and true as well. + +> **get-second** was our function for extracting the second element of an ordered pair: `\fst snd. snd`. Compare this to our definition of false. + +> **ω** is defined to be: `\x. x x` It's possible to build a logical system equally powerful as the lambda calculus (and readily intertranslatable with it) using just combinators, considered as atomic operations. Such a language doesn't have any variables in it: not just no free variables, but no variables at all.