X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week4.mdwn;h=5870a6a3ff8cca5e4ef453ca53c5bc312245c410;hp=9175c4aeaf9d478cec36e04ce49ef7ad88965261;hb=e339942e9ebf6bd1650c1640e32298a75318c55b;hpb=4acb0dcfac415c233c70e3125e333e07fa51a387 diff --git a/week4.mdwn b/week4.mdwn index 9175c4ae..5870a6a3 100644 --- a/week4.mdwn +++ b/week4.mdwn @@ -270,9 +270,9 @@ cannot have a type in Λ_T. We can easily see why: Assume Ω has type τ, and `\x.xx` has type σ. Then because `\x.xx` takes an argument of type σ and returns -something of type τ, `\x.xx` must also have type `σ --> -τ`. By repeating this reasoning, `\x.xx` must also have type -`(σ --> τ) --> τ`; and so on. Since variables have +something of type τ, `\x.xx` must also have type σ --> +τ. By repeating this reasoning, `\x.xx` must also have type +(σ --> τ) --> τ; and so on. Since variables have finite types, there is no way to choose a type for the variable `x` that can satisfy all of the requirements imposed on it. @@ -287,9 +287,9 @@ functions, one for each type. Version 1 type numerals are not a good choice for the simply-typed lambda calculus. The reason is that each different numberal has a different type! For instance, if zero has type σ, then `false` -has type τ --> τ --> &tau, for some τ. Since one is -represented by the function `\x.x false 0`, one must have type `(τ ---> τ --> &tau) --> &sigma --> σ`. But this is a different +has type τ --> τ --> τ, for some τ. Since one is +represented by the function `\x.x false 0`, one must have type (τ +--> τ --> τ) --> σ --> σ. But this is a different type than zero! Because each number has a different type, it becomes impossible to write arithmetic operations that can combine zero with one. We would need as many different addition operations as we had @@ -299,3 +299,33 @@ Fortunately, the Church numberals are well behaved with respect to types. They can all be given the type (σ --> σ) --> σ --> σ. + + + + +