15-212: Principles of Programming

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 introduce lists and polymorphic datatypes and functions.

Key Concepts

Sample Code

On-line Notes by Robert Harper


Suggested Reading in Programming in Standard ML:


[ CS 15-212 Home page | schedule | language | assignments | handouts ]


Michael Erdmann