Values, types, functions, calls, and pairs
For this toy, empty = {}, has_model = {"model"}, and remove_model(s) removes "model" from the set s.
| Term | Meaning | Example |
|---|---|---|
| Value | Concrete runtime thing | empty |
| Type | Description of allowed values | State |
| Function | Value mapping inputs to outputs | effect |
| Call | Running a function on an input | effect(empty) |
| Pair | Two values bundled together | (state, undo) |
| Plain name | Cordis symbol |
|---|---|
| State space | Γ |
| Current state | γ |
| New state | δ |
| Effect | e |
| Inverse | g |
| Effect type | EΓ |
In f : Γ × X → Γ × Y, γ is the current context and x is an ordinary input:
Here × means a product or pair type, not multiplication. It is the same idea as the pair notation (A, B) from Lesson 00.
Do not confuse a type with the names of its returned values:
new_state and inverse_function are names introduced after the call. They do not replace the product type.
Important: Γ → Γ is only a function shape. It does not mean undo by itself. For the returned-effect model, the local witness is:
This constrains g at the particular output δ; it says nothing about g at unrelated states. A stronger fixed-pair law would need to be stated separately.
For the toy model-registration example, this behavior has a precondition: the model key must not already be present. Without that precondition, removing "model" could delete an older registration.