Core Concepts and Features
Michel Charpentier

#Programming
#OOP
Leverage Modern Language Constructs to Write High-Quality Code Faster
The functional and concurrent programming language features supported by modern languages can be challenging, even for experienced developers. These features may appear intimidating to OOP programmers because of a misunderstanding of how they work. Programmers first need to become familiar with the abstract concepts that underlie these powerful features.
In Functional and Concurrent Programming, Michel Charpentier introduces a core set of programming language constructs that will help you be productive in a variety of programming languages―now and in the future. Charpentier illustrates key concepts with numerous small, focused code examples, written in Scala, and with case studies that provide a thorough grounding in functional and concurrent programming skills. These skills will carry from language to language―including the most recent incarnations of Java. Using these features will enable developers and programmers to write high-quality code that is easier to understand, debug, optimize, and evolve.
Key topics covered include:
As a bonus, the book includes a discussion of common typing strategies used in modern programming languages, including type inference, subtyping, polymorphism, type classes, type bounds, and type variance.
Most of the code examples are in Scala, which includes many of the standard features of functional and concurrent programming; however, no prior knowledge of Scala is assumed. You should be familiar with concepts such as classes, methods, objects, types, variables, loops, and conditionals and have enough programming experience to not be distracted by simple matters of syntax.
Table of Contents
Part I: Functional Programming
Chapter 1 Concepts of Functional Programming
Chapter 2 Functions in Programming Languages
Chapter 3 Immutability
Chapter 4 Case Study: Active{Passive Sets
Chapter 5 Pattern Matching and Algebraic Data Types
Chapter 6 Recursive Programming
Chapter 7 Recursion on Lists
Chapter 8 Case Study: Binary Search Trees
Chapter 9 Higher-Order Functions
Chapter 10 Standard Higher-Order Functions
Chapter 11 Case Study: File Systems as Trees
Chapter 12 Lazy Evaluation
Chapter 13 Handling Failures
Chapter 14 Case Study: Trampolines
Part II: Concurrent Programming
Chapter 16 Concepts of Concurrent Programming
Chapter 17 Threads and Nondeterminism
Chapter 18 Atomicity and Locking
Chapter 19 Thread-Safe Objects
Chapter 20 Case Study: Thread-Safe Queue
Chapter 21 Thread Pools
Chapter 22 Synchronization
Chapter 23 Common Synchronizers
Chapter 24 Case Study: Parallel Execution
Chapter 25 Futures and Promises
Chapter 26 Functional-Concurrent Programming
Chapter 27 Minimizing Thread Blocking
Chapter 28 Case Study: Parallel Strategies Appendix A Features of Java and Kotlin
About the Code Examples
The primary value of this book lies in its code illustrations. To a large extent, the text is there to support the code, more than the other way around. The code examples tend to be short and focused on the concepts they aim to illustrate. In particular, very few examples are designed to perform the specific tasks you need to solve in your daily programming activities.
Why Scala?
Michel Charpentier is an associate professor with the Computer Science department at the University of New Hampshire (UNH). His interests over the years have ranged from distributed systems to formal verification and mobile sensor networks. He has been with UNH since 1999 and currently teaches courses in programming languages, concurrency, formal verification, and model-checking.









