4. A constraint is a value too
A constraint such as <10 is a value that sits between a type and a single number.
A rule about data is written in the same notation as the data it checks, and rules combine like any other value.
Take a comparison. X is less than ten.
Drop the left side. What is left is a value, called a constraint. It means every number below ten.
It is like the height bar at a ride. The bar is not anyone's height. But it is real, and it sorts heights.
Less than ten sits below number, and above three. Between a type and a single number.
Constraints unify like any other value. Three to ten, with five to twenty, gives five to ten.
Unify less than ten with three, and you get three. The constraint and the number are the same kind of thing.
Check yourself. Where does <10 sit in the order, relative to number and to 3?
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime