02 Variants

Variants are a new way to build data types.

Perhaps you've seen a type that allows you to enumerate through constants, like an enum.

You can do something similar with variants.

See, we have a type primary_color now!

Let's make a variant for shapes!

Now let's make a rectangle and a circle!

These variables now carry all the data we need to represent our points!