O'Reilly logo

Get Programming with F#: A guide for .NET developers by Isaac Abraham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 22. Fixing the billion-dollar mistake

Hopefully, in the preceding lesson, you gained at least an initial appreciation of discriminated unions and how they allow you to quickly and easily model complex relationships. In this lesson, you’ll take a look at one specific discriminated union that’s built into F# and designed to solve a single problem: nothing! Or, more seriously, handling null values. You’ll learn about

  • Dealing with absence-of-value situations in .NET today
  • Working with optional data in F#
  • Using helper F# functions to deal with common optional scenarios

22.1. Working with missing values

Imagine you’re reading a JSON document from a car insurer that contains information on a driver, including a safety rating that’s used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required