O'Reilly logo

Programming Elixir by Dave Thomas

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

Chapter 8Dictionaries: Maps, HashDicts, Keywords, Sets, and Structs

  • The two and a half dictionary data types

  • The General Dictionary API

  • Pattern matching and updating maps

  • Structs

  • Nested data structures

A dictionary is a data type that associates keys with values.

We’ve already looked briefly at a couple of dictionary types: maps and keyword lists. In this short chapter we’ll cover how to use them with pattern matching and how to update them. We’ll also look at HashDict, another implementation of dictionaries. Finally we’ll look at the Keyword module, which implements a specialized dictionary intended for storing function and program options, and the Set module, which implements sets.

First, though, let’s answer a common question—how do we ...

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