Coverage includes an introduction to fundamental data structures and their applications. The notions of binding, environment, store, closure and evaluation are introduced in order to explain the meaning of programs in an informal but precise way. Thus, the authors provide the reader with a set of durable programming concepts which will exist well into the next generation of programming languages. Features of the book include: Attractive and reader-friendly presentation Clear and careful explanations A rich collection of programming problems and a wide variety of examples Coverage of modelling and abstraction using data structures and the SML module system Overview and statement of objectives at the start of each chapter An introduction to producing technical documentation based on the SML module system Extensive material in the appendices covering the SML language and module system and selected parts of the SML basis library Accompanying Web Site supporting the book, containing all the program code, further teaching material and links to SML systems and other useful resources 0201398206B04062001
(Each chapter concludes with a Summary and Exercises. )
1. Getting Started. Values, Types, Identifiers and Declarations. Simple Function Declarations. Comments. Recursion. The Power Function. About Types and Type Checking. Bindings and Environments.
2. Basic Values and Operators. Integers and Reals. Expressions, Precedence, Association. Euclid'S Algorithm. Evaluations with Environments. Characters and Strings. Truth Values. The If-Then-Else Expression. Overloaded Operators. Type Inference.
3. Tuples and Records. Tuples. Tuple Patterns. Infix Functions on Pairs. Records. Record Patterns. Type Declarations. Locally Declared Identifiers.
4. Problem Solving
I. Problem Statement: Rational Numbers. Solution
1. Solution
2. Comparing the Solutions. A Solution using Records.
5. Lists. Building Lists. The 'Cons'Operator. List Patterns. Append and Reverse; Polymorphic Types. Polymorphic Values. A Library of List Functions. Membership; Equality Types. Type Inference.
6. Problem Solving
Ii. Problem Analysis: Cash Register. Programming. Test.
7. Tagged Values and Partial Functions. Datatype Declarations. The Case-Expression. Enumeration Types. The Order Type. Partial Functions: The Option Datatype. Exception Handling. The Eight Queens Problem.
8. Finite Trees. Chinese Boxes. Symbolic Differentiation. Trees of Ancestors; Traversal of a Tree. Mutual Recursion. Parameterized Datatypes. Electrical Circuits. Abstract Types.
9. Higher-Order Functions. Expressions Denoting Functions. Value Declarations of Recursive Functions. The Map Function. Declaring Higher order Functions. Higher-Order List Functions. Functional Composition. Tree Recursion. Type Inference For Higher-Order Functions. Closures. Static Binding. Lazy Evaluation.
10. Finite Sets. A Representation of Sets. Operations on Sets. An Abstype for Sets. Other Representations of Sets.
11. Modules. Structures. Specifications and Signatures. Signatures and Structures. Further Facilities. Fixity of Identifiers. Functors.
12. Tables. The Table Concept. A Representation of Tables. Operations on Tables.
13. Problem Solving
Iii. Problem Analysis. A Sample Run. Programming. Test.
14. Input/Output In Sml. Input Streams. Output Streams. Simple Input and Output. Use of Conversions. Sequential Composition. Input/Output of Composite Data. Input with Prompt and Validation.
15. Interactive Programs. A Quiz Program. Actions. Action Schemas. Functions for Action Schemas. Dialogue Automaton. Dialogue Program. Action Refinement.
16. Problem Solving
Iv. Problem Analysis. Programming. Test.
17. Iteration. Resource Measures. Two Problems. Solutions: Accumulating Parameters. Iteration.
18. Imperative Programming. The Store. Operations on the Sml Store. References and Polymorphism. Arrays. The While Loop. Imperative Data Structures. Appendices. A. Sml Systems. B. Overview of Standard Ml. Lexical Conventions. Syntax. Value, Environment And Store. Types. Semantics. C. Overview of the Sml Module System. Lexical Conventions. Syntax. Interfaces and Environments. Semantics. D. Selected Parts of the Sml Basis Library. General. Numbers. Characters And Strings. Lists. Vectors. Arrays. Timers and Time. Date. Conversions. Text Input. Text Output. E. Modules of Sets and Tables. Sets. Tables. Signatures. Structures. F. The Ascii Alphabet. G. Further Reading.
Index. 0201398206T04062001