4 Days of F# in NYC!

Get 4 days of intensive F# trainings in New York by attending the Fast Track to F# course immediatelly followed by two days of Progressive F# tutorials with two tracks of hands-on tutorials.

As a limited offer, you can get a free ticket for Progressive F# tutorials, when you sign up for the Fast Track to F# training. Contact us for more details!

Start reading now!

Written by Tomas Petricek with Jon Skeet. Order from Manning or go to Amazon.com, Amazon.co.uk or your favorite book store.

MSDN Articles

The following MSDN sections were written as companion to Real-World Functional Programming. The first chapter is loosely based on chapters 1-3 of the book.

  1. Functional Programming Intro
  2. Server-Side Programming
  3. Client-Side Applications
  4. Numerical Computing
  5. Building Data-Driven Webs
  6. Visualizing Data

Section 4 was written by Yin Zhu and the remaining sections were written by Tomas Petricek.

Annotated Table of Contents

The book uses an iterative structure. In part 1 we’ll explain a few aspects of the most important topics, so that you can see the motivation and understand what makes functional programming different. Part 2 systematically discusses all the foundations of functional programming. In part 3 we build on these foundations and talks about best practices for functional programming, optimization and some advanced techniques that most of the functional programmers occasionally need. Finally, part 4 presents more complex examples showing how to use functional programming to develop larger real-world projects.

Part I. Learning to think functionally

  • Chapter 1 discusses the reasons why functional concepts are becoming increasingly important. It gives examples of existing technologies that you may already know and that benefit from some aspects of functional programming. It also shows the first sample application in F#.
  • Chapter 2 introduces the concepts behind functional programming. Without showing any details and mostly using C#, it’ll help you understand how these concepts relate to each other and what they mean for the structure of program.
  • Chapter 3 finally shows some real functional code. It demonstrates some data types used in F# such as a tuple and a list. We’ll see how to work with the types in F#, but we’ll also implement them in C# to explain how they work. This chapter introduces the idea of using functions as values, which is essential for functional programming.
  • Chapter 4 shows our first real-world application implemented in F#. We’ll use various .NET and F# libraries to implement a program for drawing pie charts. You’ll also see how to efficiently use the tools F# provides during the development process.

Part II. Fundamental Functional Techniques

  • Chapter 5 talks about values. Functional programs are written as calculations that take values as arguments and return values as results, so it is easy to see why we have to start the systematic review of functional features by looking at various kinds of values.
  • Chapter 6 describes the most common way of working with values, which is to use higher-order functions. Working with values directly often requires a lot of repetitive code, so this chapter shows how to design and implement reusable operations.
  • Chapter 7 turns the attention to architectural aspects. The structure of a functional
    application is determined by the data that it works with. We’ll use an application that manipulates and draws simple documents to demonstrate this important principle.
  • Chapter 8 focuses on the architecture of applications that need to dynamically change their behavior at runtime. This can be done using functions, so we’ll talk about them in detail and we’ll also explain related topics such as closures.

Part III. Advanced F# programming

  • Chapter 9 shows how to mix object-oriented and functional styles in F#. It demonstrates how you can use functional features like immutability with object-oriented concepts such as encapsulation when writing functional .NET libraries.
  • Chapter 10 focuses on correctness and efficiency. We’ll see how to write functions that can process data sets of arbitrary size and how to write these functions efficiently. You’ll also learn how to optimize code using imperative constructs like arrays.
  • Chapter 11 talks about refactoring, testing and laziness. We’ll explain how functional programming makes it easier to understand and improve existing code. We’ll also look at unit testing, seeing how composability and strictness remove the need for some types of test.
  • Chapter 12 starts by showing how we can work with collections of data. We’ll introduce F# sequence expressions, which are designed for this purpose. However, you’ll also see that this isn’t a built-in feature unlike its
    closest counterpart in C# – it’s an example of a more general ability to change what code means.

Part IV. Applied functional programming

  • Chapter 13 presents a common scenario when working with data in F#. It starts by downloading data using a public web service, then parses it into a structured format. Finally we see how to visualize interesting aspects using Excel.
  • Chapter 14 shows how to use functional concepts to build applications that are easy to parallelize. It demonstrates this using an image processing application and a simulation featuring animals and predators that hunt them.
  • Chapter 15 describes how to build declarative functional libraries. The chapter shows that well designed libraries can be elegantly composed. As an example, we’ll see how to create a library for creating animations and a library for representing financial contracts.
  • Chapter 16 presents the last topic of the book. It shows how to build GUI applications and in general, programs driven by external events. Implementing control flow like this is quite difficult in other languages, so we’ll look at tricks that make it much easier in F#.