Functor for making constrained numbers from specifications. This functor enforces the invariant through a private type.