Part 2. Fundamental functional techniques

 

At the beginning of this book, we said functional programming is built on top of very different foundations than those you were used to. After reading part 1, you should have an idea of how to build programs using principles like immutability and recursion. We’ve also seen basic types such as tuples and lists and used them to write our first larger functional application. Now that you know how functional concepts fit together, we can take a more systematic look at the basic building blocks that F# and other functional languages provide.

In F# you often start by experimenting using only basic functional features. This way, you can quickly get to code that works and try various approaches before choosing the best solution. In part 2 we’ll review all the basic functional features that make it possible to write the first version of program. We’ve seen the tuple type as one example of a simple functional data structure, but there are other types and other ways of working with them.

In part 2 we’ll review all the basic functional features that make it possible to write the first version of program.

In chapter 5, we’ll distinguish between values and data. Values are used locally in the program, such as a tuple returned from a function that performs division with a remainder. A list of tuples storing items in a pie chart (from chapter 4) is an example of data, because it’s a major data structure used by the whole application.

sitemap