This comprehensive introduction to the principles of functional programming using F# shows how to apply basic theoretical concepts to produce succinct and elegant programs. It demonstrates the role of functional programming in a wide spectrum of applications including databases and systems. Coverage also includes advanced features in the .NET library, the imperative features of F# and topics such as text processing, sequences, computation expressions and asynchronous computation. With a broad spectrum of examples and exercises, the book is perfect for courses in functional programming and for self-study. Enhancing its use as a text is an accompanying website with downloadable programs, lecture slides, mini-projects and links to further F# sources.
Michael R. Hansen is an Associate Professor in the Department of Informatics and Mathematical Modelling at the Technical University of Denmark. He is the author of Introduction to Programming Using SML (with Hans Rischel) and Duration Calculus: A Formal Approach to Real-Time Systems (with Zhou Chaochen). Hans Rischel is a former Associate Professor in the Department of Informatics and Mathematical Modelling at the Technical University of Denmark. He is the author of Introduction to Programming Using SML (with Michael R. Hansen).
1. Getting started; 2. Values, operators, expressions, and functions; 3. Tuples, records, and tagged values; 4. Lists; 5. Collections: lists, maps, and sets; 6. Finite trees; 7. Modules; 8. Imperative features; 9. Efficiency; 10. Text processing programs; 11. Sequences; 12. Computation expressions; 13. Asynchronous and parallel computations.