Book contents
- Frontmatter
- Contents
- Preface
- 1 The λ-calculus
- 2 Combinatory logic
- 3 The power of λ and combinators
- 4 Representing the computable functions
- 5 The undecidability theorem
- 6 The formal theories λβ and CLw
- 7 Extensionality in λ-calculus
- 8 Extensionality in combinatory logic
- 9 Correspondence between λ and CL
- 10 Simple typing, Church-style
- 11 Simple typing, Curry-style in CL
- 12 Simple typing, Curry-style in λ
- 13 Generalizations of typing
- 14 Models of CL
- 15 Models of λ-calculus
- 16 Scott's D∞ and other models
- Appendix A1 Bound variables and α-conversion
- Appendix A2 Confluence proofs
- Appendix A3 Strong normalization proofs
- Appendix A4 Care of your pet combinator
- Appendix A5 Answers to starred exercises
- References
- List of symbols
- Index
10 - Simple typing, Church-style
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- 1 The λ-calculus
- 2 Combinatory logic
- 3 The power of λ and combinators
- 4 Representing the computable functions
- 5 The undecidability theorem
- 6 The formal theories λβ and CLw
- 7 Extensionality in λ-calculus
- 8 Extensionality in combinatory logic
- 9 Correspondence between λ and CL
- 10 Simple typing, Church-style
- 11 Simple typing, Curry-style in CL
- 12 Simple typing, Curry-style in λ
- 13 Generalizations of typing
- 14 Models of CL
- 15 Models of λ-calculus
- 16 Scott's D∞ and other models
- Appendix A1 Bound variables and α-conversion
- Appendix A2 Confluence proofs
- Appendix A3 Strong normalization proofs
- Appendix A4 Care of your pet combinator
- Appendix A5 Answers to starred exercises
- References
- List of symbols
- Index
Summary
Simple types
In mathematics the definition of a particular function usually includes a statement of the kind of inputs it will accept, and the kind of outputs it will produce. For example, the squaring function accepts integers n as inputs and produces integers n2 as outputs, and the zero-test function accepts integers and produces Boolean values (‘true’ or ‘false’ according as the input is zero or not).
Corresponding to this way of defining functions, λ and CL can be modified by attaching expressions called ‘types’ to terms, like labels to denote their intended input and output sets. In fact almost all programming languages that use λ and CL use versions with types.
This chapter and the next two will describe two different approaches to attaching types to terms: (i) called Church-style or sometimes explicit or rigid, and (ii) called Curry-style or sometimes implicit. Both are used extensively in programming.
The Church-style approach originated in [Chu40], and is described in the present chapter. In it, a term's type is a built-in part of the term itself, rather like a person's fingerprint or eye-colour is a built-in part of the person's body. (In Curry's approach a term's type will be assigned after the term has been built, like a passport or identity-card may be given to a person some time after birth.)
- Type
- Chapter
- Information
- Lambda-Calculus and CombinatorsAn Introduction, pp. 107 - 118Publisher: Cambridge University PressPrint publication year: 2008