Data abstractions in SML
Below are links to the source code we "developed" in lecture.
Warm up
- An enumerated type
- A stack of integers
- A polymorphic stack
Tables
- A table datatype with functions
- A structure wrapping the above
- Signatures combined with the above
- Using functors to stamp out tables
Trees
A binary tree datatype. An example of a recursive datatype.
- Basic binary tree datatype and functions
- Combining functors with the tree datatype
Scheme!
An Sexpr datatype in SML, plus the beginnings of an interpreter!
An example of a recursive datatype.
- Sexpr datatype and functions