Functional Programming in C++
豆瓣
How to improve your C++ programs using functional techniques
Ivan Čukić
Ivan Cukic
简介
Functional programming is becoming a required skill for all programmers, and for good reason. The functional style of programming lets you write more concise code which tends to have fewer bugs. It allows you to decompose your programs into smaller, highly reusable components, without putting conceptual limits on how the software should be modularized. FP makes software development easier and software more correct and robust. These techniques can be used as a complement to those from other programming paradigms, for example OOP, which makes FP a great fit for C++ as the most popular multi-paradigm language.
Functional Programming in C++ teaches developers the practical side of functional programming and what tools C++ provides to develop software in the functional style. This practical guide starts with an introduction to functional programming that contrasts FP with the imperative style of programming. This book is full of helpful diagrams that help you to understand FP concepts and begin to think functionally. You'll learn, and with the help of lots of code examples, try out FP concepts like monads, lazy evaluation, and immutable data structures. The last few chapters take you deeper into real-world FP, covering functional design for concurrent and distributed systems as well as testing and debugging.
contents
Table of Contents
1. Introduction to functional programming
2. Getting started with functional programming
3. Functional objects
4. Creating new functions from the old ones
5. Purity -- avoiding mutable state
6. Lazy evaluation
7. Ranges
8. Data structures
9. Pattern matching
10. Monads
11. Template meta-programming
12. Functional design for concurrent and distributed systems
13. Testing and debugging