This book serves as the lecture notes for the Introduction to Functional Programming
course, at Cambridge University
For those used to imperative programming, the transition to functional programming is inevitably difficult, whatever approach is taken. While some will be impatient to get quickly to real programming, this book starts with lambda calculus, and show how it can be seen as the theoretical underpinning for functional languages. This has the merit of corresponding quite well to the actual historical line of development.
So first the book introduces lambda calculus, and shows how what was originally intended as a formal logical system for mathematics turned out to be a completely general programming language. It then discusses why we might want to add types to lambda calculus, and show how it can be done. This leads us into ML
, which is essentially an extended and optimized implementation of typed lambda calculus with a certain evaluation strategy. The book covers the practicalities of basic functional programming in ML, and discuss polymorphism and most general types. It then moves on to more advanced topics including exceptions and ML's imperative features. Finally, the book concludes with some substantial examples, which should provide evidence for the power of ML.