Programming in Standard ML

These notes are intended as a brief introduction to Standard ML (1997 dialect) for the experienced programmer. They began as lecture notes for 15-212: Fundamental Principles of Computer Science II, the second semester of the introductory sequence in the undergraduate computer science curriculum at Carnegie Mellon University.


Standard ML is a type-safe programming language that embodies many innovative ideas in programming language design. It is a statically-typed language, with a user-extensible type system. It supports polymorphic type inference, which all but eliminates the burden of specifying types of variables and greatly facilitates code re-use. It provides efficient automatic storage management for data structures and functions. It encourages functional (effect-free) programming where appropriate, but allows imperative (effect-ful) programming where necessary (e.g., for handling I/O or implementing mutable data structures). It facilitates programming with recursive data structures (such as trees and lists) by encouraging the definition of functions by pattern matching. It features an extensible exception mechanism for handling error conditions and effecting non-local transfers of control. It provides a richly expressive and flexible module system for structuring large programs, including mechanisms for enforcing abstraction, imposing hierarchical structure, and building generic modules. It is portable across platforms and implementations because it has a precise definition given by a formal operational semantics that defines both the static and dynamic semantics of the language. It provides a portable standard basis library that defines a rich collection of commonly-used types and routines.

Table of Contents

  • Overview of Standard ML
  • Core Language
  • Module Language
  • Programming Techniques
  • Sample Programs

Book Details

Author(s): Robert Harper
Format(s): PDF, HTML
File size: 737 KB
Number of pages: 297
Link: Old version. | Current version.

Leave a Reply