Chapter 14. Writing parallel functional programs

This chapter covers

  • Using immutable data to simplify parallelization
  • Working with the Task Parallel library
  • Expressing parallelism declaratively using LINQ
  • Implementing overloaded operators

We’ve already seen many arguments in favor of functional programming. One reason it’s becoming increasingly important these days is parallelism. Writing code that scales to a large number of cores is much easier in the functional style compared to using the typical imperative approach.

The two concepts from the functional world that are essential for parallel computing are the declarative programming style and working with immutable data structures. These two are closely related. The code becomes more ...

Get Real-World Functional Programming with Examples in F# and C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.