Open and Closedness
Closedness describes the state of a value in terms of extensibility. In the simplest terms, a closed value cannot have fields added and an open value can. There are a lot of rules for determining a Value’s closed state and some constructs define sets of fields. So don’t worry if it seems confusing at first, the implementation is even trickier!
Structs are open by default
Structs are open and extensible by default. You can add fields through or after conjunction. This applies recursively to all fields.
Definitions are closed by default
Definitions have a fixed structure. You can be sure no extra fields will be added. This applies recursively to all fields.
Opening and closing values
You can open definitions with
... and close structs with
These are not recursively applied, only changing the field they are used on.
Closedness with pattern constraints
Pattern constraints define a set of values. So while
d & #D is closed,
it can still have an infinite number of labels defined.
Extending definitions by embedding
Embedding allows the extension of a definition while still
receiving updates when
#D is changed.
You can add hidden fields to a closed value. This works for both definitions
and structs which have been
List open and closedness is much simpler than structs and definitions. When you use ellipses, the list is open. Any fixed elements are required in the exact position.