Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Programming with Standard ML
Meyers C., Clack C., Poon E., Prentice-Hall, Inc., Upper Saddle River, NJ, 1993. Type: Book (9780137220755)
Date Reviewed: Oct 1 1994

Despite ML’s age (Edinburgh ML was designed in the 1970s), Standard ML, its most recent descendant, is a language on the go. One can explain this rising popularity by the language’s clean design, the inherent power of functional higher-order programming, the ease of use of Milner’s strong type inference system, and the module system, which allows programming in the large. This book offers a from-scratch, hands-on introduction to this nice functional language.

The book’s structure, closely following the language specification, is classical. First, operators, values, and types are introduced. Then function definitions are described, together with their possibly polymorphic types (eqtypes are sketched as well). These functions can manipulate lists, which are the subject of chapter 3. Higher-order functionals, especially on lists, come naturally into play in chapter 4. The notion of scope, and thus environments, is presented in chapter 5. The rich datatype structure of Standard ML is the subject of the last two chapters, which cover concrete and abstract types, and structures and functors. As a bonus, numerous appendices are dedicated to Standard ML file handling capabilities, advanced features (such as unnamed functions or imperative references), the initial environment, and the system interface. The final appendix shows how lazy evaluation (Standard ML uses eager evaluation) can be emulated using closures, a classical trick. The book closes with a large section giving solutions to exercises suggested in the text, an extended and annotated bibliography, and a copious index.

Besides thoroughly describing Standard ML, this book is a good introduction to functional programming for programmers with a more imperative background. It assumes no prior knowledge of this programming paradigm and guides the reader with actual programs. The text is centered around session examples using the widely available Standard ML of New Jersey (SMLNJ) implementation from Bell Labs. An interesting algorithm, a pattern-matcher inspired by the UNIX program grep, is used throughout the book as a motivating example. The learning curve is gradual and smooth, which is rare in books with multiple authors. The pace is a bit slow at the beginning, but this may reflect the authors’ intent. I noticed an acceleration of the pace beginning in chapter 5, where quicksort is only explained in a footnote, while the map function is explained to death in chapter 4.

Not all aspects of Standard ML are explained in the main text. Much is left to the appendices, in particular nonfunctional features such as references and I/O. More details about the integration of functional and imperative traits, which is an important aspect of Standard ML, would have been interesting. Since the authors give pragmatic advice on how to use the functional features of Standard ML, they could have done the same for these operations, which must be treated cautiously. The more advanced issues, such as the interaction of references with polymorphism, have appropriately been left out of the book, however (the weak type variables of SMLNJ are not even mentioned).

The overall structure of the book is good. The exercises are numerous, and answers are given in an appendix. The index seems complete and allows this book to be used for further reference. I found a couple of minor typos, mainly near the end of the book, but they do not interfere with reading the book. Thus, I warmly recommend this book to people who are not familiar with functional programming or Standard ML; they can kill two birds with one stone. If further reading is sought, the bibliography provides appropriate pointers to the more advanced literature.

Reviewer:  P. Jouvelot Review #: CR117368
Bookmark and Share
 
Standard Ml (D.3.2 ... )
 
 
Structured Programming (D.2.2 ... )
 
 
Applicative (Functional) Programming (D.1.1 )
 
 
General (D.1.0 )
 
Would you recommend this review?
yes
no

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy