Structs

Understand how structs work in Elixir.

Why do we need structs?

When Elixir sees %{ ... }, it knows it’s looking at a map. But it doesn’t know much more than that. In particular, it doesn’t know what we intend to do with the map, whether only certain keys are allowed, or whether some keys should have default values. That’s fine for anonymous maps. But what if we want to create a typed map? A typed map has ...