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 17. Maps, dictionaries, and sets

This lesson should be a fairly easy one as we round off the collection types in F#. So far you’ve looked at collections that model ordered elements of data in some way—sequences, lists, and arrays—that behave similarly to the BCL List or IEnumerable types. You’ll now spend a little time looking at using other collection types in F#:

  • Working with the standard Generic dictionary in F#
  • Creating an immutable IDictionary
  • Using the F#-specific Map type
  • Using the F#-specific Set type

17.1. Dictionaries

F# has several dictionaries available to it. Let’s review the main types now.

17.1.1. Mutable dictionaries in F#

You almost certainly already know the System.Collections.Generic.Dictionary type from C# ...

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