Sample code from L.C. Paulson's "ML for the Working Programmer"