June 2022
Intermediate to advanced
130 pages
2h 45m
English
This chapter was extremely long, and there’s a reason for that. Key-value data is important to all functional programming. The fact that Elixir added maps after much of the language was designed complicates things some.
Let’s review.
Elixir supports three main kinds of key-value stores. The Keyword type is simply a list of tuples. It has the same performance characteristics as lists, so it’s not ideal for handling large key-value datasets where you may need to access any individual element. The Map type is designed from the ground up as an efficient key-value data structure with random access. The Struct is a type that restricts maps to a known set of keys.
We built a couple of programs ...
Read now
Unlock full access