Common Collections

In this chapter, we'll explore store multiple values with vectors, strings, and hash maps.

Common Collections

Mana's standard library includes useful data structures called collections. Unlike arrays and tuples, collections store data on the heap, so the amount of data doesn't need to be known at compile time and can grow or shrink as the program runs.

This chapter covers three commonly used collections:

  • Vector — Store a variable number of values next to each other
  • String — A collection of characters
  • Hash Map — Associate a value with a particular key

Let's start with Vectors.