Data abstractions in SML

Below are links to the source code we "developed" in lecture.

Warm up

  1. An enumerated type
  2. A stack of integers
  3. A polymorphic stack

Tables

  1. A table datatype with functions
  2. A structure wrapping the above
  3. Signatures combined with the above
  4. Using functors to stamp out tables

Trees

A binary tree datatype. An example of a recursive datatype.
  1. Basic binary tree datatype and functions
  2. Combining functors with the tree datatype

Scheme!

An Sexpr datatype in SML, plus the beginnings of an interpreter! An example of a recursive datatype.
  1. Sexpr datatype and functions