Chapter 9. Turning values into F# object types with members

This chapter covers

  • Declaring types with members
  • Using interfaces in a functional way
  • Writing class and interface types
  • Using F# code from C#

When we introduced F# in chapter 1, we described it as a multiparadigm language that takes the best elements of several worlds. Most importantly, it takes ideas from both functional and object-oriented languages. In this chapter, we’re going to look at several features inspired by OOP or that allow fluent integration with object-oriented .NET languages like C# and Visual Basic .NET (VB.NET).

This chapter is particularly important for the later steps in the F# development process. As we’ve mentioned, functional simplicity allows us to write ...

Get Real-World Functional Programming with Examples in F# and C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.