Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Latest commit

 

History

History
33 lines (22 loc) · 1.05 KB

record.md

File metadata and controls

33 lines (22 loc) · 1.05 KB

Record

The Concept

A record is a collection of fields (which can be of different types) that belong together. It is a type of product type.

What to cover

  • Syntax: how to define a record.
  • When to use records: are there alternatives over using records? When is using a record the preferred way?
  • Mutability: are records mutable or immutable? If immutable, how to return a modified version of the record?

Exercises

NBA root-for-team algorithm

In this exercise you're a big sports fan and you've just discovered a passion for NBA basketball. The reference implementation (F#) teaches:

  • Defining records
  • Creating records
  • Updating records
  • Deconstructing records
  • Pattern matching on records
  • Structural equality for records

Implementations

Track Exercise Changes
F# records None