Book description
Functional Programming in C++ teaches developers the practical side of functional programming and the tools that C++ provides to develop software in the functional style. This in-depth guide is full of useful diagrams that help you understand FP concepts and begin to think functionally.
About the Technology
Well-written code is easier to test and reuse, simpler to parallelize, and less error prone. Mastering the functional style of programming can help you tackle the demands of modern apps and will lead to simpler expression of complex program logic, graceful error handling, and elegant concurrency. C++ supports FP with templates, lambdas, and other core language features, along with many parts of the STL.
About the Book
Functional Programming in C++ helps you unleash the functional side of your brain, as you gain a powerful new perspective on C++ coding. You’ll discover dozens of examples, diagrams, and illustrations that break down the functional concepts you can apply in C++, including lazy evaluation, function objects and invokables, algebraic data types, and more. As you read, you’ll match FP techniques with practical scenarios where they offer the most benefit.
What's Inside
- Writing safer code with no performance penalties
- Explicitly handling errors through the type system
- Extending C++ with new control structures
- Composing tasks with DSLs
About the Reader
Written for developers with two or more years of experience coding in C++.
About the Author
Ivan Čukić is a core developer at KDE and has been coding in C++ since 1998. He teaches modern C++ and functional programming at the Faculty of Mathematics at the University of Belgrade.
We interviewed Ivan as a part of our Six Questions series. Check it out here.
Quotes
Offers precise, easy-to-understand, and engaging explanations of functional concepts.
- Sumant Tambe, LinkedIn
An excellent read. Comprehensive code examples illustrate the implementation of functional programming patterns using C++14/C++17 constructs.
- Keerthi Shetty, FactSet Research Systems
Provides elegant, easy-to-grasp, ready-to-use examples that will improve the way you think about coding.
- Nikos Athanasiou, BETA CAE Systems
Presents a new way of writing quality software and a new way of thinking.
- Gian Lorenzo, Meocci, CommProve
Particularly valuable for intermediate/advanced C++ developers who want to embrace reactive-style programming.
- Marco Massenzio, Apple
Table of contents
- Titlepage
- Copyright
- preface
- acknowledgments
- about this book
- about the author
- Chapter 1: Introduction to functional programming
- Chapter 2: Getting started with functional programming
- Chapter 3: Function objects
- Chapter 4: Creating new functions from the old ones
- Chapter 5: Purity: Avoiding mutable state
- Chapter 6: Lazy evaluation
- Chapter 7: Ranges
- Chapter 8: Functional data structures
- Chapter 9: Algebraic data types and pattern matching
- Chapter 10: Monads
- Chapter 11: Template metaprogramming
-
Chapter 12: Functional design for concurrent systems
- 12.1 The actor model: Thinking in components
- 12.2 Creating a simple message source
- 12.3 Modeling reactive streams as monads
- 12.4 Filtering reactive streams
- 12.5 Error handling in reactive streams
- 12.6 Replying to the client
- 12.7 Creating actors with a mutable state
- 12.8 Writing distributed systems with actors
- Summary
- Chapter 13: Testing and debugging
- Index
Product information
- Title: Functional Programming in C++
- Author(s):
- Release date: January 2019
- Publisher(s): Manning Publications
- ISBN: 9781617293818
You might also like
book
Hands-On Design Patterns with C++
A comprehensive guide with extensive coverage on concepts such as OOP, functional programming, generic programming, and …
book
Optimized C++
In today’s fast and competitive world, a program’s performance is just as important to customers as …
book
Template Metaprogramming with C++
Understand how to use modern C++ templates for writing maintainable, robust, and fast software Key Features …
book
C++ Reactive Programming
Learn how to implement the reactive programming paradigm with C++ and build asynchronous and concurrent applications …