Programming in Standard ML
Author :
Robert Harper,
Computer Science Department,
Carnegie Mellon University
Pages : 315
Working Draft : August 2006
Draft Excerpts:
This book is an introduction to programming with the
Standard ML programming language. It began life as a set of lecture notes for
Computer Science 15–212: Principles of Programming, the second semester of the introductory sequence in the undergraduate computer science curriculum at
Carnegie Mellon University. It has subsequently been used in many other courses at Carnegie Mellon, and at a number of universities around the world.
Standard ML is a type-safe programming language that embodies many innovative ideas in programming language design:
- a statically typed language, with an extensible type system.
- supports polymorphic type inference, which all but eliminates the burden of specifying types of variables and greatly facilitates code re-use.
- provides efficient automatic storage management for data structures and functions.
- encourages functional (effect-free) programming where appropriate, but allows imperative (effect-ful) programming where necessary.
- facilitates programming with recursive and symbolic data structures by supporting the definition of functions by pattern matching.
- features an extensible exception mechanism for handling error conditions and effecting non-local transfers of control.
- provides a richly expressive and flexible module system for structuring large programs, including mechanisms for enforcing abstraction, imposing hierarchical structure, and building generic modules.
- portable across platforms and implementations because it has a precise definition.
- provides a portable standard basis library that defines a rich collection of commonly-used types and routines.
There are several implementations of Standard ML available for a wide variety of hardware and software platforms. The best-known compilers are
Standard ML of New Jersey,
Moscow ML,
MLKit, and
PolyML. These are all freely available on the worldwide web. Please refer to
The Standard ML Home Page for up-to-date information on Standard ML and its implementations.
View/Download Programming in Standard ML |
Online Version |
Examples