Cover by Tao Liu

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 6. Other Unique Features

In previous chapters, I showed you exciting things you can do in F# as well as various F# data structures. This chapter itemizes the F# data structures and describes them in detail. This chapter is crucial to starting your F# development in full swing.

Working with Reference Cells

You already used the reference cell in Example 1-86 from Chapter 1. In that code, a reference cell was used to wrap a ref parameter. According to the MSDN documentation, a reference cell is a storage structure used to create mutable data. The reference cell definition is shown in Example 6-1, which is actually a record type containing a mutable variable.

Example 6-1. Reference cell definition
type Ref<'a> =
    { mutable contents: 'a }

This is ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required