Part 4. Applied functional programming

 

Although functional programming is certainly elegant, you’re probably more interested in it for practical purposes: it’s useful as a general-purpose style, and it positively excels in certain problem domains. We’ve already seen examples, such as the pie chart drawing application in chapter 4 and the simple photo browser in chapter 11, but the main purpose of these examples was to demonstrate specific concepts and techniques.

Part 4 is different. In each chapter we’ll spend most of the time talking about one real-world problem, using the most appropriate features of F# and functional programming to solve it. The code will use many of the features we’ve seen so far and will be relatively complicated given the space limitations we have for a single chapter.

There are two related areas where functional programming offers obvious advantages: asynchronous and concurrent programming.

In chapter 13, we’ll talk about asynchronous programming, but in the larger context of modern data-driven programming. We’ll obtain data asynchronously, explore its structure interactively, and visualize the results using Excel.

In chapter 14, we’ll turn our attention to parallel programming, an area where functional programming shines: immutability sidesteps the issue of modifying shared state, so programs written in a functional style are much easier to parallelize.