3. Unifying two values gives exactly one result
The & operator, unification, gives the highest value that is an instance of both sides; there is exactly one, so it does not matter which side comes first.

3. Unifying two values gives exactly one result

The & operator, unification, gives the highest value that is an instance of both sides; there is exactly one, so it does not matter which side comes first.

Two people, or two files, can each state what they need, and the result does not depend on who went first.

The ampersand combines two values. CUE calls this unifying.

The result is the highest value that is an instance of both. Unify bool with true, and you get true.

Picture two stencils, one on top of the other. Paint only gets through where both are cut.

Swap them. The result is the same. There is exactly one answer, so it does not matter which comes first.

What if nothing is an instance of both? Unify true with false, and you get bottom. An error.

Whole files unify the same way. No file wins. Both hold, or you get an error.

Check yourself. What does true & false give, and why does a & b equal b & a?

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime