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 10. Shaping data with records

In the previous lesson, you looked at a lightweight, simple way of packaging data pieces together with the tuple. You also saw that tuples are great in some situations, but in others not so much. Now you’ll look at F#’s secondary data structure: the record, a more fully featured data structure more akin to a class. In this lesson

  • You’ll see what records are within F#.
  • You’ll understand how records compare with C# and VB classes.
  • You’ll learn how to affect changes to records while still retaining immutability.
  • You’ll see tips for working with records.

Let’s start by continuing where we left off in the previous lesson and by describing a situation where tuples aren’t suitable for exposing data. For example, ...

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