Chapter 15

Optional Values

WHAT’S IN THIS CHAPTER?

  • Expressing the lack of values
  • The implementation of an Option type

Programmers of languages derived from C have long been familiar with null as a representation of “nothing.” In spite of common disadvantages that date back as long as the keyword null itself, the concept is still around today. Functional languages have a different heritage when it comes to expressing “nothing” and the approaches used there can also be mirrored in C#.

Get Functional Programming in C#: Classic Programming Techniques for Modern Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.