CS 15-212: Fundamental Structures of Computer Science II

Lecture 4: Datatypes and Patterns

One of the most important features of ML is that it allows the definition of new types with so-called datatype declarations. This means that programs can be written to manipulate the data in a natural representation rather than in complex encodings. This goes hand-in-hand with clausal function definitions using pattern matching on given data types.

We also briefly review the use of function as data, including functions as arguments and functions as results. A particularly common use is a technique called Currying which uses functional return values.

Key Concepts

Sample Code

On-line Notes by Robert Harper

[ home | schedule | language | assignments | handouts | recitations ]

Frank Pfenning
fp@cs