Chapter 1
Polymorphism
In programming language theory, polymorphism (where poly means many and morph shape) refers
to the mechanism by which the same piece of code can be reused for different types of objects. C+
templates are a good example of a language

Chapter 1
-Calculus
This chapter presents the -calculus, a core calculus for functional languages (including SML of course).
It captures the essential mechanism of computation in functional languages, and thus serves as an
excellent framework for investig

Chapter 1
Environments and Closures
The operational semantics of the simply typed (or untyped) -calculus discussed so far hinges on substitutions in reducing such expressions as applications, case expressions, and the fixed point construct.
Since the defi

Chapter 1
Evaluation contexts
This chapter presents an alternative formulation of the operational semantics for the simply typed calculus. Compared with the operational semantics in Chapter ?, the new formulation is less complex,
yet better reflects reduc

Chapter 1
Introduction to Functional
Programming
This chapter presents basic ideas underlying functional programming, or programming in functional
languages. All examples are written in Standard ML (abbreviated as SML henceforth), but it should
be straigh

Chapter 1
Inductive Definitions
This chapter discusses inductive definitions which are an indispensable tool in the study of programming
languages. The reason why we need inductive definitions is not difficult to guess: a programming
language may be thoug

Chapter 1
Extensions to the simply typed
-calculus
This chapter presents three extensions to the simply typed -calculus: product types, sum types, and the
fixed point construct. Product types account for pairs, tuples, records, and units in SML. Sum types

Chapter 1
Subtyping
Subtyping is a fundamental concept in programming language theory. It is especially important in the
design of an object-oriented language in which the relation between a superclass and its subclasses may
be seen as a subtyping relatio

Chapter 1
Simply typed -calculus
This chapter presents the simply typed -calculus, an extension of the -calculus with types. Since the
-calculus in the previous chapter does not use types, we refer to it as the untyped -calculus so that we
can differentia

Chapter 1
Mutable References
In the (typed or untyped) -calculus, or in pure functional languages, a variable is immutable in that
once bound to a value as the result of a substitution, its contents never change. While it may appear
to be too restrictive

Chapter 1
Recursive Types
In programming in a practical functional language, there often arises a need for recursive data structures
(or inductive data structures) whose components are data structures of the same kind but of smaller size.
For example, a t