Amalgam Values

Many values can be mixed together to create one, big value – as if they were a single one. A value that is made of many other values mixed together is called an amalgam value.

Note

An amalgam value is fundamentally exactly the same thing as an amalgam type, except that it is a value instead of a type. The rest of this chapter will address what applies to amalgam values.

When two values that share some members are amalgamated together, then these members are also amalgamated together. For instance, this snippet:

{
    a: '' = 'former!'
}
{
    a: '' = ' latter!'
}

represents an amalgam value which can safely be tranlated to:

{
    a: '' = 'former! latter!'
}

In other words, the order in which values are amalgamated together matters, because in the end, this order will ultimately be the order in which strings are concatenated together.